Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,5 @@
var n = 1024;
while (n > 0) {
print(n);
n /= 2;
}

View file

@ -0,0 +1,20 @@
function loopWhile(varValue, fnDelta, fnTest) {
'use strict';
var d = fnDelta(varValue);
return fnTest(d) ? [d].concat(
loopWhile(d, fnDelta, fnTest)
) : [];
}
console.log(
loopWhile(
1024,
function (x) {
return Math.floor(x/2);
},
function (x) {
return x > 0;
}
).join('\n')
);

View file

@ -0,0 +1,10 @@
512
256
128
64
32
16
8
4
2
1

View file

@ -1,5 +0,0 @@
var n = 1024;
while (n>0) {
print(n);
n/=2;
}