Chess AI created for my third year final project.
This program uses minimax search with alpha-beta pruning to traverse all possible moves up to a certain depth (e.g. thinking 3 moves ahead). Once this depth has been reached, a number of heuristics are used to evaluate the position:
- Material worth - Number of pieces left on either side. A queen is worth more than a rook, which is worth more than a pawn, etc.
- Position bonuses - Each type of piece gets bonus evaluation points based on their position on the board. For example, bishops receive a bonus for being in the centre of the board, where they have more influence over the board.
- Pawn structure - Players' evaluations are penalised by having passed, isolated, doubled and backward pawns.
- Central threat - Evaluation bonuses given for being able to attack the centre of the board. This dissuades the other player from gaining control of the important centre.