Beispiel #1
0
        public static void run()
        {
            int _choice = -1;

            Console.WriteLine("Welcome to tic tac toe game script ...!!!");
            while (true)
            {
                TicTacToeBoard._playerOne.isWiner = false;
                TicTacToeBoard._playerTwo.isWiner = false;
                Console.Write("1 in default config, 2 for add details, 3 for exit : ");
                try
                {
                    _choice = Convert.ToInt32(Console.ReadLine());
                    if (_choice == 1)
                    {
                        Console.WriteLine("Loading game in default settings ...");
                        BoardDriver.runGame();
                    }
                    else if (_choice == 2)
                    {
                        Console.Write("player one name : ");
                        TicTacToeBoard._playerOne.Name = Console.ReadLine();
                        Console.Write("player two name : ");
                        TicTacToeBoard._playerTwo.Name = Console.ReadLine();
                        BoardDriver.runGame();
                    }
                    else if (_choice == 3)
                    {
                        Console.WriteLine("Thank you for playing the game ...");
                        break;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message.ToString());
                }
            }
        }
Beispiel #2
0
 static void Main(string[] args)
 {
     BoardDriver.run();
 }