Example #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();
            }
        }
 private void Analisys()
 {
     if (analysis.Checked)
     {
         bot.ChangeDifficulty(diff.SelectedIndex);
         Console.WriteLine(game.gameStateToString());
         String scores = bot.Analysis(game.gameStateToString());
         AppendLog(scores);
         game.EnableAnalysis(scores);
     }
     else
     {
         game.DisableAnalysis();
     }
 }