Submodules
Constants
Procedures
choice

Picks and returns a random item from the array src, advancing the state of the global generator.

Arguments

array - [any]

Returns

any

flt

Generates and returns a random float, advancing the state of the global generator.

Arguments

Returns

float

flt_in

Generates and returns a random float (at least min and at most max), advancing the state of the global generator.

Arguments

min - float

max - float

Returns

float

int

Generates and returns a random integer, advancing the state of the global generator.

Arguments

Returns

int

int_in

Generates and returns a random integer (at least min and at most max), advancing the state of the global generator.

Arguments

min - int

max - int

Returns

int

new

Creates a new semi-random deterministic number generator, intialized with the integer seed.

Arguments

seed - any

Returns

{ flt_in = |<ref *0> { flt = |<circular *1>| -> (int | float), ... }, (int | float), (int | float)| -> (int | float), seed = |{ state = any, ... }, any| -> { state = any, ... }, int_in = |<ref *1> { int = |<circular *2>| -> int, ... }, int, int| -> int, state = any, choice = |<ref *2> { int_in = |<circular *3>, int, int| -> int, ... }, [any]| -> any, sample = |<ref *3> { int_in = |<circular *4>, int, int| -> int, ... }, [any]| -> || -> ( #next any | ... ), int = |{ state = int, ... }| -> int, flt = |<ref *4> { int = |<circular *5>| -> (int | float), ... }| -> float }

sample

Returns a new infinite iterator where for each item in the iterator it picks a random item from the array src, advancing the state of the global generator every time.

Arguments

array - [any]

Returns

|| -> ( #next any | ... )