dice

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

Dice

This package provides a simple way of generating various multisided dice. It accepts a slice of strings with each string with dice roll expressions. Dice expressions are formed by the number of dice, a dice description, and a simple arithmatic express of any modifiers. Dice descriptions begin with the letter "d" followed (without a space) by an integer (e.g. "d4", "d6", "d8").

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelpText = `` /* 1531-byte string literal not displayed */

)
View Source
var ShowTotalOnly bool

Functions

func Dice

func Dice(noOfSides int) int

Dice models a dice of N sides where N must be a postive integer greater than zero. If N is greater than zero a random value in the range of 1 to N is returned. If not a negative one is returned.

func DoRollDice

func DoRollDice(in io.Reader, out io.Writer, eout io.Writer, args []string) error

func ParseRoll

func ParseRoll(src string) (int, int, int, error)

func RollDice

func RollDice(out io.Writer, args []string, displayRoll bool) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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