Пример #1
0
 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();
 }
Пример #2
0
        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)) + " % )";
                }
            }
        }
Пример #3
0
        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);
        }