如果你击败了minimax算法的电脑,请务必联系我,下次让你去单防alphago (: 所有文件之间没有依赖关系,你可以把整个文件夹下载下来,也可以单独下载你想要的代码。运行的时候单独运行你需要的代码即可
推荐环境:python3.10(其他版本不知道行不行) 如果有bug请联系我,万分感谢
Thanks for your watching
The Tic-tac-toe is realized by minimax algorithm and Monte Carlo tree search respectively The most basic minimax algorithm, without any pruning Based on minimax, alpha-beta pruning is used to reduce time complexity Using pure random search simulation, the performance is poor, and the win rate is low Heuristic algorithm is introduced to improve performance and win rate I use "-- -- -- -- -- -- -- -- - - - - - - - - - - - - - - - - -" to mark a position in MCTS.py and MCTS_optimize.py. You can modify two parameter: C(coefficient when calculating UFC) and iterations(number of iterations) to adjust the intensity of computer chess, see MCTS_optimize.py for details In theory, you can't defeat a computer using minimax, it's possible to defeat MCTS (if the C Settings are too extreme or the iteration Settings are too small). If you beat the minimax algorithm computer, please be sure to contact me and let you go to single-defense alphago next time (: There are no dependencies between all the files, you can download the entire folder or download the code you want individually. When running, just run the code you need separately
Recommended environment: python3.10(maybe python>3.6 is ok. I haven't tried it) Please contact me if there are any bugs. Thank you very much
Thanks for your watching