Example #1
0
        private bool TakeMove(Player hero, Player enemy)
        {
            bool wasHit;

            do
            {
                var guessedCell = hero.TakeShot();
                wasHit = enemy.CheckForHit(guessedCell);

                if (wasHit && enemy.Dead())
                {
                    return true;
                }
            } while (wasHit);

            return false;
        }
Example #2
0
        private bool TakeMove(Player hero, Player enemy)
        {
            bool wasHit;

            do
            {
                var guessedCell = hero.TakeShot();
                wasHit = enemy.CheckForHit(guessedCell);

                if (wasHit && enemy.Dead())
                {
                    return(true);
                }
            } while (wasHit);

            return(false);
        }