diff --git a/X10D/ListExtensions.cs b/X10D/ListExtensions.cs index 3c654c5..bcc7886 100644 --- a/X10D/ListExtensions.cs +++ b/X10D/ListExtensions.cs @@ -69,5 +69,24 @@ /// Returns shuffled. public static IEnumerable Shuffle(this IEnumerable source, Random random) => source.OrderBy(_ => random.Next()); + + /// + /// Shuffles a list. + /// + /// The collection type. + /// The collection to shuffle. + /// Returns shuffled. + public static IEnumerable Shuffle(this IList source) => + source.Shuffle(new Random()); + + /// + /// Shuffles a list. + /// + /// The collection type. + /// The collection to shuffle. + /// The instance. + /// Returns shuffled. + public static IEnumerable Shuffle(this IList source, Random random) => + source.OrderBy(_ => random.Next()); } }