KGy SOFT

EnumerableExtensionsShuffleT Method (IEnumerableT, Int32)

KGy SOFT Core Libraries Help
Shuffles an enumerable source (randomizes its elements) using the provided seed with a new FastRandom instance.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0-rc.2
Syntax

public static IEnumerable<T> Shuffle<T>(
	this IEnumerable<T> source,
	int seed
)

Parameters

source
Type: System.Collections.GenericIEnumerableT
The IEnumerableT to shuffle its elements.
seed
Type: SystemInt32
The seed to use for the shuffling.

Type Parameters

T
The type of the elements of source.

Return Value

Type: IEnumerableT
An IEnumerableT that can enumerate the items of source in a randomized order.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Note Note
Subsequent enumerations of the returned collection shuffles the order of the items again an again.
Note Note
The enumerator of the returned collection does not support the IEnumerator.Reset method.
See Also

Reference