https://github.com/signpostmarv/diceroll
diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.
https://github.com/signpostmarv/diceroll
Last synced: over 1 year ago
JSON representation
diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.
- Host: GitHub
- URL: https://github.com/signpostmarv/diceroll
- Owner: SignpostMarv
- License: other
- Created: 2013-07-06T14:45:22.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T04:23:31.000Z (over 3 years ago)
- Last Synced: 2025-01-03T16:26:17.082Z (over 1 year ago)
- Language: TypeScript
- Size: 486 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About diceRoll
diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.
## Examples
```typescript
const instance = new DiceRoll('2d10+4');
const assert = 2 === instace.count;
const assert = 10 === instace.faces;
const assert_action = '+' === instace.modifier.action;
const assert_modifier = 4n === instace.modifier.modifier;
(new DiceRoll('2d10+4')).roll();
(new DiceRoll('2d10+4')).multiRoll(10);
```