test.js 879 B

12345678910111213141516
  1. const db = require('./dice')
  2. const seedrandom = require('seedrandom')
  3. const sr = () => {
  4. const rng = seedrandom(1)
  5. return () => rng.double()
  6. }
  7. const n = 2
  8. Array(n).fill().map(x => console.log(db.Dice.chat('roll 2d10', {rng: sr()})))
  9. Array(n).fill().map(x => console.log(db.Dice.chat('roll 1d10', {rng: sr()})))
  10. Array(n).fill().map(x => console.log(db.Dice.chat('roll 3d10', {rng: sr()})))
  11. Array(n).fill().map(x => console.log(db.Dice.chat('roll 3d6', {rng: sr()})))
  12. Array(n).fill().map(x => console.log(db.Dice.chat('roll 1d6', {rng: sr()})))
  13. Array(n).fill().map(x => console.log(db.Dice.chat('roll 1d2', {rng: sr()})))
  14. Array(n).fill().map(x => console.log(db.Dice.chat('roll 5d2', {rng: sr()})))
  15. Array(n).fill().map(x => console.log(db.Dice.chat('roll 5d12', {rng: sr()})))
  16. Array(n).fill().map(x => console.log(db.Dice.chat('roll percentile', {rng: sr()})))