aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/README.md
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2025-09-13 02:34:14 +0800
committer简律纯 <i@jyunko.cn>2025-09-13 02:34:14 +0800
commit00670619f3a9ac80683f1a1d751349e010c602dc (patch)
tree242ccdbede9b38099ed773ea5ab725ded053843f /README.md
parent93d462c41cf0ed359475f07578bac511a329c580 (diff)
downloadOneRoll-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.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/README.md b/README.md
index edfca7a..8d31755 100644
--- a/README.md
+++ b/README.md
@@ -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