コード例 #1
0
        static void Main(string[] args)
        {
            random    = new Random();
            gameGrid  = new GameGrid(random);
            ControlF  = new ControlFlow(gameGrid);
            userInput = new UserInput(gameGrid);

            Console.WriteLine("PLAY BATTLESHIP!\n");
            StartGame(userInput);
        }
コード例 #2
0
        //Member Methods (CAN DO)
        public void DisplayGrid()
        {
            GameGrid grid = new GameGrid();

            for (int i = 0; i < grid.grid.GetLength(0); i++)
            {
                for (int j = 0; j < grid.grid.GetLength(1); j++)
                {
                    //Console.Write("[ " + grid.grid[i, j] + "] ");
                    grid.grid[i, j] = "[ ]";
                }
                Console.WriteLine(" \n");
            }
            Console.ReadLine();
        }
 public ControlFlow(GameGrid _gameGrid)
 {
     gameGrid = _gameGrid;
 }
 public UserInput(GameGrid gameGrid)
 {
     GameGrid = gameGrid;
 }