seedrandom-demo
v1.0.3
Published
seedrandom demo
Downloads
274
Readme
seedrandom-demo
Project setup
npm install --save seedrandom-demo
Project test
import { RandomUtil } from "seedrandom-demo";
let seed = Date.now().toString();
let randomUtil1 = new RandomUtil({ seed, type: 0 });
console.log("randomUtil1 seed:", randomUtil1.getSeed());
console.log("randomUtil1 random value:", randomUtil1.random());
console.log("randomUtil1 random value:", randomUtil1.random());
console.log("randomUtil1 random value:", randomUtil1.random());
let randomUtil2 = new RandomUtil({ seed, type: 1 });
console.log("randomUtil2 seed:", randomUtil2.getSeed());
console.log("randomUtil2 random value:", randomUtil2.random());
console.log("randomUtil2 random value:", randomUtil2.random());
console.log("randomUtil2 random value:", randomUtil2.random());
let randomUtil3 = new RandomUtil({ seed, type: 1, min: 1, max: 100 });
console.log("randomUtil3 seed:", randomUtil3.getSeed());
console.log("randomUtil3 random value:", randomUtil3.random());
console.log("randomUtil3 random value:", randomUtil3.random());
console.log("randomUtil3 random value:", randomUtil3.random());