UNPKG

491 BJavaScriptView Raw
1var eve = require('../../index');
2
3// configure eve to use a deterministic random function
4eve.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
12console.log(eve.system.random()); // 0.6679106145469952
13console.log(eve.system.random()); // 0.2835968192967816
14console.log(eve.system.random()); // 0.00871733037746353