seeded-random-engine
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -19,6 +19,5 @@ export = SeededRandomEngine; | ||
history: number[][]; | ||
memory: number; | ||
ff(generation?: number): void; | ||
to(generation?: number): void; | ||
generate(): void; | ||
values(): number[]; | ||
} |
{ | ||
"name": "seeded-random-engine", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"main": "index.mjs", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/jakealbaugh/seeded-random-engine", |
@@ -26,4 +26,4 @@ # Seeded Random Engine | ||
// Fast forward the engine to generation 57 | ||
engine.ff(57); | ||
// Change the engine generation to 57 | ||
engine.to(57); | ||
// Any engine sharing this seed and set to generation 57 will always yield the same values. | ||
@@ -45,4 +45,2 @@ console.log(engine.values()); | ||
A seeded RNG can also be "fast forwarded." This means if a new device wants to join others, the others share the seed and the current "generation" (how many times the engine has been used), and the new device can catch up. | ||
The core use case for this engine is one where human beings can do that sync easily together. I can tell my friend "enter seed 'willie' and we are at generation 100." With two small inputs, my friend can sync their device with everyone else and be looking at the exact same randomized data. |
Sorry, the diff of this file is not supported yet
4724
95
45