Ejemplo n.º 1
0
    public static void Main()
    {
        MineSweep_Screen.Screen();
        MineSweep_Mines mines = new MineSweep_Mines();
        List <string>   mines2 = mines.getMines();
        int             pos, count = 0, minesArround;
        bool            mineSelect = false;

        do
        {
            minesArround = 0;
            Console.SetCursorPosition(50, 2);
            Console.Write("Column:");
            int column = Convert.ToInt32(Console.ReadLine());
            Console.SetCursorPosition(50, 4);
            Console.Write("Row:");
            int row = Convert.ToInt32(Console.ReadLine());
            pos = MineSweep_Movement.NewPosition(column, row);
            if (mines2[pos] == "x")
            {
                mineSelect = true;
            }
            if (mines2[pos] == "o")
            {
                count++;
                if (mines2[pos + 1] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos + 10] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos + 11] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos + 9] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos - 1] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos - 10] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos - 11] == "x")
                {
                    minesArround++;
                }
                if (mines2[pos - 9] == "x")
                {
                    minesArround++;
                }
            }
        } while (!mineSelect || count < 70);
    }
Ejemplo n.º 2
0
 public static void Main()
 {
     MineSweep_Screen.Screen();
 }