Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,22 @@
class SubRandom(seed, state=[]) {
const mod = 1_000_000_000;
method init {
var s = [seed % mod, 1];
53.times {
s.append((s[-2] - s[-1]) % mod);
}
state = s.range.map {|i| s[(34 + 34*i) % 55] };
range(55, 219).each { self.subrand };
}
method subrand {
var x = ((state.shift - state[-24]) % mod);
state.append(x);
return x;
}
}
var r = SubRandom(292929);
10.times { say r.subrand };