Random generator for boolean values.
let value1 = RandomBoolean.nextBoolean(); // Possible result: true let value2 = RandomBoolean.chance(1,3); // Possible result: false
Calculates "chance" out of "max chances". Example: 1 chance out of 3 chances (or 33.3%)
a chance proportional to maxChances.
a maximum number of chances
Generates a random boolean value.
a random boolean.
Generated using TypeDoc
Random generator for boolean values.
Example
let value1 = RandomBoolean.nextBoolean(); // Possible result: true let value2 = RandomBoolean.chance(1,3); // Possible result: false