Simple algebraic dice notation parser for Gleam
3

Configure Feed

Select the types of activity you want to include in your feed.

Gleam 68.7%
Nix 13.4%
Other 17.9%
17 1 3

Clone this repository

https://tangled.org/sheetr.app/diced https://tangled.org/did:plc:zdtceaz4aps3dhuxultiiuq7
git@tangled.org:sheetr.app/diced git@tangled.org:did:plc:zdtceaz4aps3dhuxultiiuq7

For self-hosted knots, clone URLs may differ based on your setup.



README.md

Diced#

Simple algebraic dice notation parser for Gleam

Package Version Hex Docs

gleam add diced
import diced

pub fn main() {
  echo diced.parse("1d6")
  // Ok(diced.Basic(1, 6, []))
  
  echo diced.parse("5d20kh2kl2")
  // Ok(diced.Basic(5, 20, [diced.KeepHighest(2), diced.KeepLowest(2)]))
  
  echo diced.parse("1")
  // Ok(diced.Number(1, []))
  
  echo diced.parse("4dF")
  // Ok(diced.Fate(4, []))
}

Further documentation can be found at https://hexdocs.pm/diced.

Development#

gleam run   # Run the project
gleam test  # Run the tests