示例#1
0
        public void StartGame(IGridOperations grid)
        {
            do
            {
                turn++;
                Console.WriteLine("Turn " + turn);
                grid.ShowGrid();                
                finish = grid.CheckCellPosition(turn);

                if (!finish)
                {
                    grid.RevealNeighbors();
                    finish = grid.Win();
                }

            }
            while (!finish);

            if (grid.Win())
            {
                Console.WriteLine("You Won the game in  " + turn + " turns :)");
                grid.RevealMines();
            }
            else
            {
                Console.WriteLine("ooh you step over the Mine, :(");
                grid.RevealMines();
            }
        }
示例#2
0
 public Play()
 {
     _Grid = new Grid(new GridIO());
     StartGame(_Grid);
 }