Add basic background rendering
This commit is contained in:
parent
0c5ad88981
commit
fc8d282509
10 changed files with 156 additions and 8 deletions
11
js/util.mjs
Normal file
11
js/util.mjs
Normal file
|
@ -0,0 +1,11 @@
|
|||
export class SeededRandom {
|
||||
constructor(seed) {
|
||||
this.seed = seed % 2147483647;
|
||||
}
|
||||
|
||||
next() {
|
||||
this.seed = this.seed * 16807 % 2147483647;
|
||||
if (this.seed <= 0) this.seed += 2147483646;
|
||||
return (this.seed - 1) / 2147483646;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue