Ejemplo n.º 1
0
        public void GetsTargetAndConvertsToIntArrayWhenGivenStringOfTwoChars()
        {
            Game   game  = new Game();
            string input = "A0";

            int[] expected = { 0, 0 };

            var actual = game.GetTarget(input);

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 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!");
        }