Method UniformRandomInt
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
UniformRandomInt(int)
Makes a generator that generates integers uniformly distributed between 0 (included) and the specified limit (excluded).
public static IGenerator<int> UniformRandomInt(int upperLimitExcluded)
Parameters
upperLimitExcluded
intThe upper limit (excluded).
Returns
- IGenerator<int>
IGenerator<System.Int32>.
Exceptions
- ArgumentOutOfRangeException
upperLimitExcluded
is not positive.
UniformRandomInt(int, int)
Makes a generator hat generates integers uniformly distributed between 0 (included) and the specified limit (excluded).
public static IGenerator<int> UniformRandomInt(int upperLimitExcluded, int seed)
Parameters
upperLimitExcluded
intThe upper limit (excluded).
seed
intThe seed to use for the random number generator.
Returns
- IGenerator<int>
A new generator.
Exceptions
- ArgumentOutOfRangeException
upperLimitExcluded
is not positive.