diff options
author | rubidium <rubidium@openttd.org> | 2014-09-19 20:06:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-09-19 20:06:51 +0000 |
commit | 79ca66eb673c710432d1f4e51af70730a09a82c8 (patch) | |
tree | 5c26b5456711549c69e6d7c74b6e966072670cb6 /src/3rdparty/squirrel/samples/list.nut | |
parent | bd0cd31d4b4e13dcf99c3b4170069d9eb08a91cf (diff) | |
download | openttd-79ca66eb673c710432d1f4e51af70730a09a82c8.tar.xz |
(svn r26853) -Cleanup [Squirrel]: remove some stuff that we never did and especially never should use
Diffstat (limited to 'src/3rdparty/squirrel/samples/list.nut')
-rw-r--r-- | src/3rdparty/squirrel/samples/list.nut | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/3rdparty/squirrel/samples/list.nut b/src/3rdparty/squirrel/samples/list.nut deleted file mode 100644 index 8ab1ab517..000000000 --- a/src/3rdparty/squirrel/samples/list.nut +++ /dev/null @@ -1,39 +0,0 @@ -/*translation of the list test from The Great Computer Language Shootout -*/ - -function compare_arr(a1,a2) -{ - foreach(i,val in a1) - if(val!=a2[i])return null; - return 1; -} - -function test() -{ - local size=10000 - local l1=[]; l1.resize(size); - for(local i=0;i<size;i+=1) l1[i]=i; - local l2=clone l1; - local l3=[] - - l2.reverse(); - while(l2.len()>0) - l3.append(l2.pop()); - while(l3.len()>0) - l2.append(l3.pop()); - l1.reverse(); - - if(compare_arr(l1,l2)) - return l1.len(); - return null; -} - -local n = ARGS.len()!=0?ARGS[0].tointeger():1 -for(local i=0;i<n;i+=1) - if(!test()) - { - print("failed"); - return; - } - -print("oki doki"); |