From 2e7cff9561b439485d3bff4d0cad4d0251ee7d24 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 12 Sep 2025 19:02:00 +0800 Subject: chore: remove README.rst as part of project restructuring --- README.md | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 113 ----------------------------------------------------------- 2 files changed, 116 insertions(+), 113 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..edfca7a --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +OneRoll +======= + +An efficient dice expression parsing tool, based on Rust and PEG grammar. + +Overview +-------- + +OneRoll is a high-performance dice expression parser and roller, implemented in Rust and exposed to Python via PyO3. It supports complex dice expressions, modifiers, mathematical operations, and user comments. + +Features + +-------- + +- Basic dice rolling (XdY) +- Mathematical operations: +, -, *, /, ^ +- Modifiers: !, kh, kl, dh, dl, r, ro +- Bracket support +- User comments (e.g., `3d6 + 2 # Attack roll`) +- Complete error handling +- Statistical rolling and analysis +- Rich terminal UI (TUI) via `textual` +- Python SDK and CLI + +Installation +------------ + +```shell +pip install oneroll +``` + +Or build from source: + +```shell +maturin build +pip install target/wheels/oneroll-*.whl +``` + +Usage +----- + +Python SDK Example: + +```python + + import oneroll + + # Basic roll + result = oneroll.roll("3d6 + 2") + print(result["total"]) + + # With comment + result = oneroll.roll("4d6kh3 # Attribute roll") + print(result["comment"]) + + # Use OneRoll class + roller = oneroll.OneRoll() + result = roller.roll("2d6! # Exploding dice") +``` + +Command Line Example: + +```shell + +python -m oneroll "3d6 + 2" +python -m oneroll --stats "3d6" --times 100 +``` + +Terminal UI: + +```shell +python -m oneroll.tui +``` + +Dice Expression Syntax +---------------------- + +- `XdY`: Roll X dice with Y sides +- Modifiers: `kh`, `kl`, `dh`, `dl`, `!`, `r`, `ro` +- Mathematical operations: `+`, `-`, `*`, `/`, `^` +- Comments: Add with `#`, e.g., `3d6 + 2 # Attack roll` + +Examples +-------- + +```python +# Basic +result = oneroll.roll("3d6 + 2") + +# D&D attribute roll +result = oneroll.roll("4d6kh3 # Attribute") + +# Statistical analysis +stats = oneroll.roll_statistics("3d6", 100) + +# Comment usage +result = oneroll.roll("1d20 + 5 # Attack check") +print(result["comment"]) +``` + +Documentation +------------- + +- Homepage: https://hydroroll.team/ +- Repository: https://github.com/HydroRoll-Team/oneroll +- Docs: https://oneroll.hydroroll.team/ + +License +------- + +AGPL-3.0 + +Authors +------- + +HsiangNianian \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index 868d783..0000000 --- a/README.rst +++ /dev/null @@ -1,113 +0,0 @@ -OneRoll -======= - -An efficient dice expression parsing tool, based on Rust and PEG grammar. - -Overview --------- - -OneRoll is a high-performance dice expression parser and roller, implemented in Rust and exposed to Python via PyO3. It supports complex dice expressions, modifiers, mathematical operations, and user comments. - -Features --------- - -- Basic dice rolling (XdY) -- Mathematical operations: +, -, *, /, ^ -- Modifiers: !, kh, kl, dh, dl, r, ro -- Bracket support -- User comments (e.g., `3d6 + 2 # Attack roll`) -- Complete error handling -- Statistical rolling and analysis -- Rich terminal UI (TUI) via `textual` -- Python SDK and CLI - -Installation ------------- - -.. code-block:: shell - - pip install oneroll - -Or build from source: - -.. code-block:: shell - - maturin build - pip install target/wheels/oneroll-*.whl - -Usage ------ - -Python SDK Example: - -.. code-block:: python - - import oneroll - - # Basic roll - result = oneroll.roll("3d6 + 2") - print(result["total"]) - - # With comment - result = oneroll.roll("4d6kh3 # Attribute roll") - print(result["comment"]) - - # Use OneRoll class - roller = oneroll.OneRoll() - result = roller.roll("2d6! # Exploding dice") - -Command Line Example: - -.. code-block:: shell - - python -m oneroll "3d6 + 2" - python -m oneroll --stats "3d6" --times 100 - -Terminal UI: - -.. code-block:: shell - - python -m oneroll.tui - -Dice Expression Syntax ----------------------- - -- `XdY`: Roll X dice with Y sides -- Modifiers: `kh`, `kl`, `dh`, `dl`, `!`, `r`, `ro` -- Mathematical operations: `+`, `-`, `*`, `/`, `^` -- Comments: Add with `#`, e.g., `3d6 + 2 # Attack roll` - -Examples --------- - -.. code-block:: python - - # Basic - result = oneroll.roll("3d6 + 2") - - # D&D attribute roll - result = oneroll.roll("4d6kh3 # Attribute") - - # Statistical analysis - stats = oneroll.roll_statistics("3d6", 100) - - # Comment usage - result = oneroll.roll("1d20 + 5 # Attack check") - print(result["comment"]) - -Documentation -------------- - -- Homepage: https://hydroroll.team/ -- Repository: https://github.com/HydroRoll-Team/oneroll -- Docs: https://oneroll.hydroroll.team/ - -License -------- - -AGPL-3.0 - -Authors -------- - -HsiangNianian \ No newline at end of file -- cgit v1.2.3-70-g09d2