Example #1
0
        static void Main(string[] args)
        {
            TicTacToe t = new TicTacToe();

            t.DisplayTheBoard();
            string inputPos;

            while (!t.GameOver)
            {
                Console.Write("Enter your position (X) To Exit:");
                inputPos = Console.ReadLine();

                if (inputPos.ToLower() == "x")
                {
                    t.GameOver = true;
                    break;
                }
                if (!t.PutMark(inputPos, 'X'))
                {
                    Console.WriteLine(t.Message);
                }
                else
                {
                    t.DisplayTheBoard();
                }
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            TicTacToe t = new TicTacToe();
            t.DisplayTheBoard();
            string inputPos;
            while (!t.GameOver)
            {
                Console.Write("Enter your position (X) To Exit:");
                inputPos = Console.ReadLine();

                if (inputPos.ToLower() == "x")
                {
                    t.GameOver = true;
                    break;
                }
                if (!t.PutMark(inputPos, 'X'))
                    Console.WriteLine(t.Message);
                else
                {
                    t.DisplayTheBoard();
                }

            }
        }