Пример #1
0
        private void botField_MouseClick(object sender, MouseEventArgs e)
        {
            if (botGameIsPlaying)
            {
                botGameCopy = botGame.Clone();

                if (botGame.SetMark(new Point(e.X, e.Y), playerColor) == "ERROR")
                {
                    return;
                }

                CheckGameState();



                if (!botGame.GameIsEnded())
                {
                    String gameState = botGame.gameStateToString();
                    String botMove   = bot.NextMove(gameState);
                    Console.WriteLine(botMove);

                    botGame.SetMark(botMove);

                    CheckGameState();

                    if (analysis.Checked && botGameIsPlaying)
                    {
                        botGame.DisableAnalysis();
                        botGame.Draw();
                        String scores = bot.Analysis(botGame.gameStateToString());
                        botGame.EnableAnalysis(scores);
                    }
                }
                botGame.Draw();
            }
        }
Пример #2
0
 private void UnmakeLastMove()
 {
     botGame     = botGameCopy.Clone();
     botGameCopy = null;
 }