September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,12 @@
fcn rand_sub(x){
var ring=L(),m=(1e9).toInt();
mod:='wrap(n){ if(n<0) n+m else n };
if(not ring){
seed:=L( (if(vm.numArgs) x else m-1), 1);
foreach n in ([2 .. 54]){ seed.append((seed[n-2]-seed[n-1]):mod(_)) }
foreach n in (55){ ring.append(seed[(34*(n+1))%55]) }
do(220-ring.len()){ self.fcn() } // 165
}
ring.append((ring.pop(0)-ring[-24]):mod(_));
return(ring[-1]);
}

View file

@ -0,0 +1 @@
do(4){ println(rand_sub(292929)) } //seed ignored after first call