static void Main(string[] args) { Game game = new Game(new ConsoleGameDisplay(), new IPlayer[] { new ConsolePlayer(), new RandomPlayer(), new RandomPlayer(), new RandomPlayer() }); Piece winner = game.Run(); Console.WriteLine(String.Format("Player {0} won.", winner)); Console.ReadKey(); }
private void Run_Click(object sender, RoutedEventArgs e) { for (int j = 0; j < 4000; j++) { Game game = new Game(this, new IPlayer[] { new BasicPlayer(), new RandomPlayer(), new RandomPlayer(), new RandomPlayer() }); Piece winner = game.Run(); wins[(int)winner - 1]++; total++; for (int i = 0; i < 4; i++) { scoreControls[i].Content = wins[i] + " ( " + Math.Round((double)(100.0 * wins[i]/total)) + " % )"; } } }
public ThreadedLimakeGame(PlayerType Green, PlayerType Red, PlayerType Blue, PlayerType Yellow) { beersDrunk = new int[5]; IPlayer[] players = new IPlayer[] { GetPlayer(Green), GetPlayer(Red), GetPlayer(Blue), GetPlayer(Yellow) }; game = new Game(this, players); }