quick

package
v0.0.0-...-47c6eec Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package qdice provides non-CSPRNG dice. Rolling this die is much quicker than the CSPRNG based die and does not generate garbage.

The random number generator needs to be seeded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Die

type Die struct {
	// contains filtered or unexported fields
}

Die has n sides. Use New(n) to get an n-sided die. This die uses math/rand. which is not a CSPRNG. Don't forget to seed math/rand.

func New

func New(n int) Die

New returns a n-sided die.

func (Die) Roll

func (d Die) Roll() int

Roll returns the result of a die roll. This is not CSPRNG. Seeding of math/rand is required before the first Roll.

Jump to

Keyboard shortcuts

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