random

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package random contains logic related to randomly generating things.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDiceString = errors.New("invalid dice string")

ErrInvalidDiceString is returned if the dice string doesn't have the format "0d0[+0d0+...]".

Functions

func RollDice

func RollDice(diceStr string) (int, error)

RollDice returns a random number generated by rolling the specified dice. The dice are specified as a string with the format "0d0[+0d0+...]", where the 0s can be any positive integers or 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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