Esempio n. 1
0
 private void AutoPlay()
 {
     for (int i = 0; i < 10; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             Cell targetCell = new Cell(i, j);
             if (computerField.CheckIfMarked(targetCell))
             {
                 continue;
             }
             PlayerTurn(targetCell);
             if (computerField.CheckIfComputerLost())
             {
                 Congratulate();
                 computerFieldArea.Enabled = false;
                 return;
             }
             ComputerTurn();
             if (playerField.CheckIfPlayerLost())
             {
                 ShowGameOverMessage();
                 computerFieldArea.Enabled = false;
                 return;
             }
         }
     }
 }