Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T04:23:31.000Z (about 2 years ago)
- Last Synced: 2024-05-02T01:15:06.818Z (8 months 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);
```