Method RandomBoolGenerator
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
RandomBoolGenerator(float)
Makes a generator that returns random boolean values, true with the specified probability.
public static IGenerator<bool> RandomBoolGenerator(float probability)
Parameters
probability
floatThe probability of generating $(true).
Returns
- IGenerator<bool>
A new generator.
Exceptions
- ArgumentException
probability
does not lie between 0 and 1 (inclusive)
RandomBoolGenerator(float, int)
Makes a generator that returns random boolean values, true with the specified probability.
public static IGenerator<bool> RandomBoolGenerator(float probability, int seed)
Parameters
probability
floatThe probability of generating $(true).
seed
intThe seed to use for the random num ber generator.
Returns
- IGenerator<bool>
A new generator.
Exceptions
- ArgumentException
probability
does not lie between 0 and 1 (inclusive)