No description
Find a file
2025-05-09 16:32:27 +01:00
birdie_snapshots Switch to Birdie snapshot testing 2025-05-07 16:03:46 +01:00
docs Change Recursive Reroll representation in spec to avoid token collisions 2025-05-07 16:03:46 +01:00
src Add code docs 2025-05-09 16:31:51 +01:00
test Switch to Birdie snapshot testing 2025-05-07 16:03:46 +01:00
.gitignore Intital Commit 2024-12-01 18:38:14 +00:00
gleam.toml Bump version 2025-05-09 16:32:27 +01:00
LICENSE Intital Commit 2024-12-01 18:38:14 +00:00
manifest.toml Switch to Birdie snapshot testing 2025-05-07 16:03:46 +01:00
README.md Update README.md 2025-05-07 16:22:15 +01:00

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