Skip to content

Die-Sir (Dicer) is a dice parser for random dice rolling with support for modifiers through math operations

License

Notifications You must be signed in to change notification settings

hggmarks/die-sir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Die-Sir

Die-Sir (Dicer) is a dice parser for random dice rolling with support for modifiers through basic math operations

Usage

Add this to your Cargo.toml:

[dependencies]
die-sir = "0.1.0"

Basic usage example:

use die_sir::evaluate;

fn main() {
    let result = evaluate("2d6 + 3".to_string());
    match result {
        Ok(val) => println!("Result: {}", val),
        Err(e) => println!("Error: {}", e),
    }
}

Features

  • Parse dice expressions (e.g., "2d6", "1d20+5")
  • Support for basic arithmetic operations (+, -, *, /, ^)
  • Error handling for invalid expressions and number overflow

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Die-Sir (Dicer) is a dice parser for random dice rolling with support for modifiers through math operations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages