Table of Contents

Shuffle Method

Definition

Namespace
Cuemon.Extensions.Collections.Generic
Assemblies
Cuemon.Extensions.Collections.Generic.dll
Source
src/Cuemon.Extensions.Collections.Generic/EnumerableExtensions.cs

Shuffle<T>(IEnumerable<T>)

Shuffles the specified source like a deck of cards.

public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source)

Parameters

source IEnumerable<T>

An IEnumerable<T> to extend.

Returns

IEnumerable<T>

A sequence of T with the shuffled source.

Type Parameters

T

Remarks

Shuffle<T>(IEnumerable<T>, Func<int, int, int>)

Shuffles the specified source like a deck of cards.

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

Parameters

source IEnumerable<T>

An IEnumerable<T> to extend.

randomizer Func<int, int, int>

The function delegate that will handle the randomization of source.

Returns

IEnumerable<T>

A sequence of T with the shuffled source.

Type Parameters

T

Remarks