GNOLL

GNOLL: Efficient Multi-Lingual Software for Real-World Dice Notation and Extensions - Published in JOSS (2023)

https://github.com/ianfhunter/gnoll

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    1 of 19 committers (5.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

board-game c cpp dice dice-notation dice-roller dice-rolls go golang haskell java javascript js julia perl python r roleplaying-games rpg-dice-roller ttrpg

Keywords from Contributors

data-integration data-manipulation genomics multi-omics

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 4 months ago · JSON representation ·

Repository

GNOLL is an efficient dice notation parser for multiple programming languages that supports a wide set of dice notation

Basic Info
Statistics
  • Stars: 46
  • Watchers: 3
  • Forks: 24
  • Open Issues: 57
  • Releases: 45
Topics
board-game c cpp dice dice-notation dice-roller dice-rolls go golang haskell java javascript js julia perl python r roleplaying-games rpg-dice-roller ttrpg
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Security

README.md

GNOLL

Downloads

Test: Functionality Test: Language Bindings Test: OS Support

CodeFactor Codacy Badge

status TTRPG compatibility rate GitHub license GitHub last commit Donate

An easy to integrate dice notation library for multiple programming languages. Use for instant support of common syntax and a library that can scale with your demands, rather than a sticky taped monstrousity of regular expressions and tears.

Here's an example of how you might use GNOLL: ```markdown Grindon The Brave: I want to steal from the goblin sitting at the bar. Dungeon Master: Okay, give me a stealth check! Grindon The Brave: Okay, that's a <1d20+5>

Dungeon Master: Hurrah! You successfully pickpocket the goblin! However, all he had in there were some crummy dice... ```

You can follow Grindon's full adventure through the world of dice notation in our Documentation.

Many of our notation design decisions are explained in the documentation and compared to other dice notation parsers.

Play around

Try out our web demo! ✨

Current Status

🧑‍💻 Language Support

GNOLL was written to be the definitive solution to dice notation. The core has been written in C, but fear not! You can use GNOLL in many other programming languages too. Here are some we have examples for:

C C++ C# Go Haskell Java JavaScript Julia Lua Perl PHP Python R Ruby Rust

Primarily tested on Linux (Ubuntu), but functional in various forms on Windows (10, WSL) and Mac.

🎲 Dice Notation

  • XdY notation
  • Arithmetic
  • Fate Dice
  • Miscellaneous Symbolic Dice
  • Shorthands & Macros
  • Alternate Syntax
  • Explosions
  • Drop/Keep
  • Rerolling
  • Filtering
  • Functions

There's so many different things, we'd bore you to list them all here. For the specific details of supported notation, check out our documentation.

Getting Started

Usage from a package manager

Python

bash pip3 install GNOLL

Then, in your code: ```python from gnoll import roll roll("1d20")

(0, [[12]], None)

(return code, final result, dice breakdown (if enabled))

```

Or, use the command-line interface (see --help): sh $ python3 -m gnoll 2d4 6 $ function gnoll() { python3 -m gnoll --breakdown "$@" ; } $ gnoll 3d6 + 10 [5, 5, 4] --> 24

🛠️ Installing From Source

Basic Requirements

bash sudo apt-get install bison flex make python3-pip -y pip install -r reqs/requirements.txt make all

To verify your setup, try our tests: bash make test Or, just try some commands yourself!

bash $ ./build/dice 1d20 20 If you would like to run the 'dice' command from anywhere, use make install to add the executable to your path.

(Note that not all commands may not be able to be used this way as some symbols are reserved for use by different terminal interfaces (e.g. bash uses ! and #))

For languages other than Python/C/C++ call the corresponding make target after the commands above.

🐛 Issues / Bugs / FAQs / Feature Requests

If you encounter any issues or have any ideas, please file them in our Issue Tracker.

✋ Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

🔢 Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

🤹 Authors / Contributers / Attributions

See also the list of contributors who participated in this project.

📃 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.

Individual licensing arrangements can be made if this is an issue for your project - Contact Me at LinkedIn to discuss.

👏 Acknowledgments

🏗️ Built With

  • Flex & Bison - Grammar Lexing & Parsing
  • uthash - C hashtable lib
  • PCG - Random Number Generation
  • Arc4Random - Random Number Generation (Cryptographically secure)
  • Love! 💖

💰 Donate

Keep this project alive

Owner

  • Name: Ian Hunter
  • Login: ianfhunter
  • Kind: user
  • Location: Meath/Cavan, Ireland
  • Company: AMD

AI Engine Software Engineer @ AMD/Xilinx. Ex-Intel/Movidius

JOSS Publication

GNOLL: Efficient Multi-Lingual Software for Real-World Dice Notation and Extensions
Published
January 17, 2023
Volume 8, Issue 81, Page 4816
Authors
Ian Frederick Vigogne Goodbody Hunter ORCID
Independent Researcher
Editor
Gabriela Alessio Robles ORCID
Tags
Perl C Go R Java Julia statistics board games ttrpgs game design

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: >-
  GNOLL: Efficient Multi-Lingual Software for Real-World
  Dice Notation and Extensions
message: 'If you use this software, please cite it using the following metadata'
type: software
authors:
  - given-names: Ian Frederick Vigogne Goodbody
    family-names: Hunter
    email: ianfhunter@gmail.com
    name-particle: Ian
    orcid: 'https://orcid.org/0000-0003-3408-8138'
identifiers:
  - type: doi
    value: 10.21105/joss.04816
    description: JOSS Paper
repository-code: 'https://github.com/ianfhunter/GNOLL'
url: 'https://www.ianhunter.ie/GNOLL/'
abstract: >-
  GNOLL is an open-source library for parsing commonly used
  dice notations in gaming system

  research and/or software development. GNOLL is performant,
  supports most popular and obscure

  notations, has permissive licensing, and is integratable
  into many other systems due to it being

  written in C
keywords:
  - dice notation
  - dice
  - board games
  - tabletop roleplaying games
license: GPL-3.0
commit: 3bd126678e4c87b652eabe535701faec8d0fab04
version: v4.3.2
date-released: '2023-01-17'

GitHub Events

Total
  • Issues event: 2
  • Watch event: 5
  • Delete event: 7
  • Issue comment event: 25
  • Push event: 29
  • Pull request event: 16
  • Fork event: 1
  • Create event: 8
Last Year
  • Issues event: 2
  • Watch event: 5
  • Delete event: 7
  • Issue comment event: 25
  • Push event: 29
  • Pull request event: 16
  • Fork event: 1
  • Create event: 8

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 1,768
  • Total Committers: 19
  • Avg Commits per committer: 93.053
  • Development Distribution Score (DDS): 0.062
Past Year
  • Commits: 23
  • Committers: 1
  • Avg Commits per committer: 23.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Ian Hunter i****r@g****m 1,659
deepsource-autofix[bot] 6****] 46
Kineolyan k****n@p****m 22
CodeWAdi 1****i 12
infiniteverma v****5@g****m 7
Matthew Fernandez m****z@g****m 3
Snyk bot s****t@s****o 3
Frey t****7@g****m 2
Kodi Arfer K****t 2
Will Jones f****1@g****m 2
oliviacarino o****o@g****m 2
Daniel S. Katz d****z@i****g 1
DeepSource Bot b****t@d****o 1
Michael McDermott m****d 1
Pyr0x1 P****1 1
aswarth m****y@g****m 1
itsagift 3****t 1
kai k****4@g****m 1
whitesource-bolt-for-github[bot] w****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 63
  • Total pull requests: 124
  • Average time to close issues: 6 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 7
  • Total pull request authors: 7
  • Average comments per issue: 1.32
  • Average comments per pull request: 1.18
  • Merged pull requests: 102
  • Bot issues: 0
  • Bot pull requests: 14
Past Year
  • Issues: 4
  • Pull requests: 18
  • Average time to close issues: N/A
  • Average time to close pull requests: 4 days
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.5
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ianfhunter (53)
  • steven-murray (4)
  • Kodiologist (2)
  • defunky (1)
  • K900 (1)
  • JuliaTagBot (1)
Pull Request Authors
  • ianfhunter (147)
  • deepsource-autofix[bot] (14)
  • snyk-bot (3)
  • michaeljmcd (2)
  • Kodiologist (2)
  • danielskatz (1)
  • InfiniteVerma (1)
Top Labels
Issue Labels
Feature Request (24) bug (22) good first issue (11) hacktoberfest (10) help wanted (7) New-Language-Support (4) Macro Request (4) Multiple Assignees (4) Test Request (4) Low/No Code (4) JOSS (4) high-priority (3) Python (2) invalid/wont-fix/duplicate (2) low-priority (2) PHP (1) Julia (1) Ruby (1) C (1) C++ (1) R (1) Perl (1)
Pull Request Labels
core (26) Python (21) JavaScript (16) Go (6) R (6) Perl (5) java (4) bug (2) haskell (1)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 294 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 105
  • Total maintainers: 1
proxy.golang.org: github.com/ianfhunter/gnoll
  • Versions: 57
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.4%
Average: 10.0%
Dependent repos count: 10.6%
Last synced: 4 months ago
pypi.org: gnoll

An efficient dice notation parser with extended notation

  • Versions: 35
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 294 Last month
Rankings
Dependent packages count: 6.6%
Forks count: 8.7%
Downloads: 11.2%
Stargazers count: 11.8%
Average: 13.8%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 4 months ago
pypi.org: dice-tower

a comprehensive dice notation parser

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 0
Rankings
Dependent packages count: 4.8%
Dependent repos count: 6.3%
Forks count: 8.6%
Stargazers count: 11.3%
Average: 18.0%
Downloads: 58.9%
Last synced: 9 months ago
juliahub.com: GnollDiceNotation

GNOLL is an efficient dice notation parser for multiple programming languages that supports a wide set of dice notation

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 8.0%
Dependent repos count: 9.9%
Stargazers count: 18.9%
Average: 18.9%
Dependent packages count: 38.9%
Last synced: 4 months ago

Dependencies

reqs/apt_requirements.txt pypi
  • bison *
  • flex *
reqs/requirements.txt pypi
  • build *
  • cppyy *
  • pytest *
  • twine *
.github/workflows/lint_codeQL.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/lint_sourcecloud.yml actions
  • SonarSource/sonarcloud-github-action master composite
  • actions/checkout v2 composite
.github/workflows/manual_benchmarking.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
.github/workflows/manual_leakcheck.yml actions
  • actions/checkout v3 composite
.github/workflows/publish_JOSS.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/publish_PyPi.yml actions
  • Vampire/setup-wsl v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
.github/workflows/publish_docs.yml actions
  • actions/checkout v3 composite
  • actions/configure-pages v2 composite
  • actions/deploy-pages v1 composite
  • actions/jekyll-build-pages v1 composite
  • actions/upload-pages-artifact v1 composite
.github/workflows/test_OS.yml actions
  • Vampire/setup-wsl v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/test_core.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/test_language_bindings.yml actions
  • KyleMayes/install-llvm-action v1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • shivammathur/setup-php v2 composite
.github/workflows/test_packages.yml actions
  • Vampire/setup-wsl v1 composite
  • actions/checkout v2 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/util_Greetings.yml actions
  • actions/first-interaction v1 composite
.github/workflows/util_Labeller.yml actions
  • actions/labeler v4 composite
.github/workflows/util_julia_TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
scripts/benchmark/requirements.txt pypi
  • d20 *
  • dice *
  • func_timeout *
  • matplotlib *
  • numpy >=1.22.2
  • python-dice *
  • rpg-dice *
  • setuptools >=65.5.1
scripts/histogram/requirements.txt pypi
  • matplotlib *
  • numpy >=1.22.2
  • scipy *