by biafra · 9y ago · 0 comments
> const RiggedDie = require('gamblers-dice')
> const die = new RiggedDie(20) // for a d20
> console.log(die.roll()) // 1 -> 20
> console.log(die.roll()) // keep using the same instance
Do I put it in a file? Do I copy paste it into a REPL? If so what provides that REPL?
I am always surprised when sample code providers assume I know their languages ecosystem.
UPDATE: Apparently I can use "node" as a REPL for this.
No comments yet.