Exemple #1
0
        private void PlayAI()
        {
            int AIButton = 0;

            // AI's Turn
            Stopwatch sw = new Stopwatch();

            sw.Start();

            // Run stopwatch to delay move (simulate thinking)
            do
            {
            } while (sw.ElapsedMilliseconds < 500);
            sw.Stop();
            sw.Reset();

            // AI Moves
            AIButton = game.AIMove();
            SetButton(AIButton);
            CheckWin();
            WhoStartsGame();
        }