Пример #1
0
        public void MakeWholeMapWater()
        {
            Game game = new Game();

            game.FillNewMap();
            bool isAllWater = true;

            foreach (var coordinate in game.map)
            {
                if (coordinate != State.Water)
                {
                    isAllWater = false;
                }
            }

            Assert.True(isAllWater);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Game game = new Game();

            game.FillNewMap();

            Ship battleship = new Ship(5);
            Ship destroyerA = new Ship(4);
            Ship destroyerB = new Ship(4);

            battleship.Spawn(game.map);
            destroyerA.Spawn(game.map);
            destroyerB.Spawn(game.map);

            while (!game.GameWon())
            {
                game.DrawMap();
                game.ShootTarget(game.GetTarget(Console.ReadLine()));
            }
            Console.WriteLine("Congrats!");
        }