Menu

## DiceBag
in package

DiceBag.php : 9

A collection of random number generators, with various distributions.

### Table of Contents

chance() : bool
  Returns true $p percent of the time, where $p is between 0 and 1.
dice() : int
  Generates a uniformly randomly integer between $min and $max.
normal() : float
  Generates a normally distributed random number between $min and $max.
pseudoBell() : int
  This function has uniform distribution except for the extreme values, which are half as likely to happen.
uniform() : float
  Generates a uniformly randomly number between $min and $max.

### Methods

#### chance()

DiceBag.php : 16

Returns true $p percent of the time, where $p is between 0 and 1.

`public chance(float $p) : bool`

##### Parameters

$p : float

##### Return values

bool —

True if you are lucky, False if not.

#### dice()

DiceBag.php : 40

Generates a uniformly randomly integer between $min and $max.

`public dice(int $min, int $max) : int`

##### Parameters

$min : int
$max : int

##### Return values

int —

random number between $min and $max

#### normal()

DiceBag.php : 61

Generates a normally distributed random number between $min and $max.

`public normal(float $min, float $max) : float`

##### Parameters

$min : float
$max : float

##### Return values

float —

normally distributed random number

#### pseudoBell()

DiceBag.php : 91

This function has uniform distribution except for the extreme values, which are half as likely to happen.

`public pseudoBell([int|null $min = null ][, int|null $max = null ]) : int`

The code for this function was taken from LotGD in version 0.9.7.

##### Parameters

$min : int|null = null
$max : int|null = null

##### Tags

author

  MightyE, JT

##### Return values

int —

#### uniform()

DiceBag.php : 29

Generates a uniformly randomly number between $min and $max.

`public uniform(float $min, float $max) : float`

##### Parameters

$min : float
$max : float

##### Return values

float —

random number between $min and $max

## Search results