// Fisher–Yates shuffle public static void Shuffle <T>(this IRandomNumbersProvider rng, T[] array) { int n = array.Length; while (n > 1) { int k = rng.Next(n--); T temp = array[n]; array[n] = array[k]; array[k] = temp; } }
public Move DetermineNextMove(Game game) { List <Move> availableMoves = GetAvailableMoves(game); return(availableMoves.ElementAt(_randomNumbersProvider.Next(0, availableMoves.Count))); }
protected virtual bool ShouldPlayOptimalMove() { return(_randomNumbersProvider.Next(0, 100) > MistakeProbability); }