(svn r15578) -Change: unexternalise squirrel.

This commit is contained in:
rubidium
2009-02-25 01:21:50 +00:00
parent 66a8c0a132
commit 1ad50ce4e6
81 changed files with 14906 additions and 0 deletions

28
src/3rdparty/squirrel/samples/array.nut vendored Normal file
View File

@@ -0,0 +1,28 @@
/*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
local n, i, k;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
local x = []; x.resize(n);
local y = []; y.resize(n);
for (i = 0; i < n; i+=1) {
x[i] = i + 1;
y[i] = 0;
}
for (k = 0 ; k < n; k+=1) {
for (i = n-1; i >= 0; i-=1) {
y[i] = y[i]+ x[i];
}
}
print(y[0].tostring()+" "+y[n-1]);