Othello, the Moor of Venice is a tragedy by William Shakespeare, believed to have been written in approximately 1603, and based on the Italian short story "Un Capitano Moro" ("A Moorish Captain") by Cinthio, a disciple of Boccaccio, first pub lished
利用上一篇的框架,再写了个翻转棋的程序,为了调试minimax算法,花了两天的时间。
几点改进说明:
拆分成四个文件:board.py,player.py,ai.py,othello.py。使得整个结构更清晰,更通用,更易于维护。
AI 的水平跟 minimax 的递归深度,以及评价函数有关。基于此,我把 minimax 和评价函数都放到 AI 类里面
AIPlayer 使用了多重继承。继承了 Player 与 AI 两个类
Game 类中把原run函数里的生成两个玩家的部分提出