dice

package
v0.0.0-...-9d02aa9 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright (C) 2026 Cryptic Codex LLC SPDX-License-Identifier: GPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Rolls []int
	Total int
}

type Roll

type Roll struct {
	Count, Sides, Modifier int
}

func Parse

func Parse(s string) (Roll, error)

Parse parses a string in the format of "<C>d<S> +/- <M>" to create a roll object. This function trims whitespace, only allows for one use of the die designator 'd', and disallows (for now) multiplication or division modifiers

func (Roll) Roll

func (r Roll) Roll() Result

Jump to

Keyboard shortcuts

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