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.py
contains all the functionalities of the checkers game such as move generators,
minimax algorithm and evaluation functions. The functions are well documented.Game.py
contains the functions of the GUIMinimaxVsMinimax.py
contains 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.py
contains 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_PLAYER
orMode.SINGLE_PLAYER
- You can change the starting player in
Game.py
it can be eitherCheckers.BLACK
orCheckers.WHITE
- You can change the algorithm used to play a computer move, it can be either
Algorithm.MINIMAX
orAlgorithm.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.evaluate2
orCheckers.endGame
.evaluate2
is harder thanevaluate1
endGame
is 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_DEPTH
toTrue
orFalse
, 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.