This commit is contained in:
Andrey Sharshov
2025-11-16 18:54:31 +01:00
commit 9487728656
2342 changed files with 62687 additions and 0 deletions

16
utils/SeededRandom.js Normal file
View File

@@ -0,0 +1,16 @@
export class SeededRandom {
constructor(seed) {
this.seed = seed;
}
// Generates a random number
next() {
this.seed = (this.seed * 9301 + 49297) % 233280;
return this.seed / 233280;
}
// Generates a random integer within a range
nextInt(min, max) {
return Math.floor(this.next() * (max - min + 1)) + min;
}
}