1 | var eve = require('../../index');
|
2 |
|
3 | // configure eve to use a deterministic random function
|
4 | eve.system.init({
|
5 | random: {
|
6 | deterministic: true, // false by default
|
7 | seed: 'my seed' // optional, 'random seed' by default.
|
8 | }
|
9 | });
|
10 |
|
11 | // the random function will now always return the same sequence of random values
|
12 | console.log(eve.system.random()); // 0.6679106145469952
|
13 | console.log(eve.system.random()); // 0.2835968192967816
|
14 | console.log(eve.system.random()); // 0.00871733037746353
|