MoreEnumerable.Random Method (Random, Int32, Int32) |
Returns an infinite sequence of random integers between a given
minumum and a maximum using the supplied random number generator.
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntaxpublic static IEnumerable<int> Random(
Random rand,
int minValue,
int maxValue
)
Public Shared Function Random (
rand As Random,
minValue As Integer,
maxValue As Integer
) As IEnumerable(Of Integer)
public:
static IEnumerable<int>^ Random(
Random^ rand,
int minValue,
int maxValue
)
static member Random :
rand : Random *
minValue : int *
maxValue : int -> IEnumerable<int>
Parameters
- rand
- Type: System.Random
Generator used to produce random numbers - minValue
- Type: System.Int32
Inclusive lower bound of the values returned - maxValue
- Type: System.Int32
Exclusive upper bound of the values returned
Return Value
Type:
IEnumerable<Int32>An infinite sequence of random integers
ExceptionsException | Condition |
---|
ArgumentNullException | Thrown if rand is null. |
See Also