Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var board = new Board(9, 9, 10);

            while (true)
            {
                Console.WriteLine("Write quit to leave or the coordinates row,col");
                var response = Console.ReadLine();
                if (response == "" || response == "quit")
                {
                    break;
                }
                else
                {
                    var arrResponse = response.Split(',');
                    if (arrResponse.Length != 2)
                    {
                        break;
                    }
                    var row = Int32.Parse(arrResponse[0]);
                    var col = Int32.Parse(arrResponse[1]);
                    board.Select(row, col);
                    board.PrintBoard(false);
                    if (board.Status == Constants.GameStatus.Ended)
                    {
                        Console.WriteLine("Game Ended");
                        board.PrintBoard(true);
                        break;
                    }
                }
            }
            Console.WriteLine("Process done");
            Console.ReadLine();
        }