Random

class Varwin.Random

Bases: object

Provides extension methods for working with random numbers.

static TrueWithProbability(value: float) bool

Returns True with the given probability, otherwise False.

Example:

result = Varwin.Random.TrueWithProbability(0)
static RandInt(a: int, b: int) int

Returns an integer in the specified range

Example:

result = Varwin.Random.RandInt(0, 0)
static RandFloat(a: float, b: float) float

Returns a real number in the specified range

Example:

result = Varwin.Random.RandFloat(0, 0)