dice

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDiceExpression

func ParseDiceExpression(diceExpression string) (
	numDice int64,
	damageDice int64,
	bonus int64,
)

ParseDiceExpression takes a string diceExpression, and parses 3 strings from it! The number of dice being rolled {X}, the value of the dice being rolled {Y}, and the modifier being applied to the roll {Z}. An input dice roll should look like one of the following: - XdY: roll X dice of Y value. - XdY+Z: roll X dice of Y value adding Z. - XdY-Z: roll X dice of Y value subtracting Z.

func SumRollDice

func SumRollDice(diceExpression string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL