Example #1
0
 private void playAI(object sender, EventArgs e)
 {
     foreach (Control x in this.Controls)
     {
         if (x is Button && x.Text == "?" && x.Enabled)
         {
             x.Enabled     = false;
             currentPlayer = Player.O;
             x.Text        = currentPlayer.ToString();
             x.BackColor   = System.Drawing.Color.LightGoldenrodYellow;
             AITIMER.Stop();
             Check();
             break;
         }
         else
         {
             AITIMER.Stop();
         }
     }
 }