コード例 #1
0
        public void GameIsWonWhenScoreAboveOrEqualMaxScore()
        {
            Game game = new Game();

            game.IncreaseScore(13);
            Assert.True(game.GameWon());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: aluczynski/Battleships
        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!");
        }