Game of checkers, with alpha-beta pruning playing agent and different evaluation functions
You must have python3 installed.
just type in the terminal python Game.py to run the game.
it's cross-platform, and tested on both ubuntu and windows
Checkers.pycontains all the functionalities of the checkers game such as move generators,
minimax algorithm and evaluation functions. The functions are well documented.Game.pycontains the functions of the GUIMinimaxVsMinimax.pycontains code to run minimax agent against another minimax agent with different or same parameters.
It's just for comparing between different evaluation functions and hyperparameters.MinimaxVsRandom.pycontains code to run minimax agent against random playing agent.
It's for the same purpose asMinimaxVsMinimax.py
Refer to the Report for more information about experiment and results
- You can change the size of the checkers instead of the default 8*8 to any even number greater than 3.
- You can change the mode of the game, it can be either
Mode.MULTIPLE_PLAYERorMode.SINGLE_PLAYER - You can change the starting player in
Game.pyit can be eitherCheckers.BLACKorCheckers.WHITE - You can change the algorithm used to play a computer move, it can be either
Algorithm.MINIMAXorAlgorithm.RANDOM(minimax is much harder).
- You can change the
maxDepth, the higher the max depth the harder the level of play and the more time it takes to compute the play. - You can change the evaluation function, it can be either
Checkers.evaluate1,Checkers.evaluate2orCheckers.endGame.evaluate2is harder thanevaluate1endGameis used at the end of the game, when there is no much pieces on the board, it's good for traping and escaping
- You can set
INCREASE_DEPTHtoTrueorFalse, if it's true, then at the end of the game the max depth will increase, to be able to search more for a solution.
