Beispiel #1
0
        static void Main(string[] args)
        {
            (int x, int y)input = (-1, -1);
            (bool placed, bool won, bool tied)response = (true, false, false);

            do
            {
                WriteBoard();
                Console.WriteLine();

                if (!response.placed)
                {
                    Console.WriteLine("You can't put that there. Try somewhere else.\n");
                }

                input = _game.Players[_game.GetPlayer() - 1].Move(_game);

                response = _game.PlaceToken(input.y, input.x);
                input    = (-1, -1);

                Console.Clear();
            } while (!(response.won || response.tied));

            WriteBoard();
            if (response.won)
            {
                Console.WriteLine("\nCongratulations, Player " + _game.GetPlayer() + " (" + "OX".Substring(_game.GetPlayer() - 1, 1) + "), you won!");
            }
            else
            {
                Console.WriteLine(" It's a tie. Everyone wins! *smirk* ");
            }

            Console.WriteLine("\nPress Enter to Exit.  That makes perfect sense, right?");
            Console.ReadLine();
        }