Exemplo n.º 1
0
        private int[] ifOnlyOneHit()
        {
            int row;
            int col;

            int[] dir;
            int   count = 0;

            do
            {
                dir = MyBoard.ConvertDirectionInputToLoopInfo(count);
                row = LastHit[0] + dir[0];
                col = LastHit[1] + dir[1];
                count++;
                if (count > 5)
                {
                    return(resetLastHit());
                }
            } while (row < 1 || row > BoardSize || col < 1 || col > BoardSize || MyEnemyBoard.Matrix[row][col].HasBeenGuessed);
            return(new int[] { row, col });
        }