diff options
| author | 2025-09-13 02:34:14 +0800 | |
|---|---|---|
| committer | 2025-09-13 02:34:14 +0800 | |
| commit | 00670619f3a9ac80683f1a1d751349e010c602dc (patch) | |
| tree | 242ccdbede9b38099ed773ea5ab725ded053843f /README.md | |
| parent | 93d462c41cf0ed359475f07578bac511a329c580 (diff) | |
| download | OneRoll-00670619f3a9ac80683f1a1d751349e010c602dc.tar.gz OneRoll-00670619f3a9ac80683f1a1d751349e010c602dc.zip | |
feat: introduce new dice modifiers for grouping and merging, enhance variable references and instruction sequences in parser
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -76,9 +76,11 @@ Dice Expression Syntax ---------------------- - `XdY`: Roll X dice with Y sides -- Modifiers: `kh`, `kl`, `dh`, `dl`, `!`, `r`, `ro` +- Modifiers: `kh`, `kl`, `dh`, `dl`, `!`, `e`, `r`, `ro`, `R`, `a`, `u`, `s`, `c`, `m`, `g`, `gs` - Mathematical operations: `+`, `-`, `*`, `/`, `^` - Comments: Add with `#`, e.g., `3d6 + 2 # Attack roll` +- Instruction sequences: Use `;` to separate multiple instructions +- Variable references: Use `$n` to reference the result of the nth instruction Examples -------- @@ -96,6 +98,18 @@ stats = oneroll.roll_statistics("3d6", 100) # Comment usage result = oneroll.roll("1d20 + 5 # Attack check") print(result["comment"]) + +# Instruction sequences +result = oneroll.roll("3d6; 1d20; 2d8") + +# Variable references +result = oneroll.roll("3d6; $1c6") # Count 6s in first roll + +# Group modifier +result = oneroll.roll("4d6g10") # Count groups >= 10 + +# Count modifier +result = oneroll.roll("5d6c6") # Count occurrences of 6 ``` Documentation |
