ArrayExtensions.Shuffle<T>
Extension Method in ArrayExtensions
Declaration
public static void Shuffle<T>(this T[] array)
Description
Shuffles the array in place. The shuffle is done using the Fisher-Yates algorithm.
Type Parameters
T | The type of the array. |
Parameters
array | The array to shuffle. |
Overload
Declaration
public static void Shuffle<T>(this T[] array, Random rng)
Description
Shuffles the array in place using the given random number generator. The shuffle is done using the Fisher-Yates algorithm.
Type Parameters
T | The type of the array. |
Parameters
array | The array to shuffle. |
rng | The random number generator to use. |