test.js 1.2 KB

1234567891011121314151617181920212223
  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()})))
  17. console.log(db.Dice.chat('roll 4d6, reroll ones, and take the highest three x6'))
  18. console.log(db.Dice.chat('roll 4d4, reroll ones, and drop the lowest one'.toUpperCase()))
  19. console.log(db.Dice.chat('roll 1d6 x45'))
  20. console.log(db.Dice.chat('roll percentile x10'))
  21. console.log(db.Dice.chat('roll percentile x0'))
  22. console.log(db.Dice.chat('Dicebot help'))