MoreEnumerableRandom(Random, Int32) Method

Returns an infinite sequence of random integers between zero and a given maximum using the supplied random number generator.

Definition

Namespace: MoreLinq
Assembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
C#
public static IEnumerable<int> Random(
	Random rand,
	int maxValue
)

Parameters

rand  Random
Random generator used to produce values
maxValue  Int32
Exclusive upper bound for random values returned

Return Value

IEnumerableInt32
An infinite sequence of random integers

Exceptions

ArgumentNullExceptionThrown if rand is .

See Also