dice

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dice provides methods for simulating the rolling of polyhedral dice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Roll

func Roll(dice Dice) int

Roll rolls "num" number of dice with "sides" sides and returns the total result

Types

type Dice

type Dice struct {
	Number int `json:"number" db:"number"`
	Sides  int `json:"sides" db:"sides"`
}

Dice is a representation of polyhedral dice

func ParseFromString

func ParseFromString(input string) (Dice, error)

ParseFromString returns a Dice struct parsed from a string

Jump to

Keyboard shortcuts

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