Bitboard implementation for Chess in Python
This project implements Chess bitboards using NumPy 64-bit integers and various NumPy array functions for rotated bitboard implementation. This process is used to store all possible orthogonal and diagonal moves, and their respective blocker formations calculated as a unique index. A legal move generator is created by keeping track of pinned pieces and other game conditions to reduce the need for recalculating opposing attacks.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
pip install bit-chess-python
If you want to run PERFT, import the PERFT class and call the perft function:
from BitChess import Perft
perft = Perft(FEN_string)
perft.perft(1)
- NumPy
- gmpy2
- Inspired by Sebastian Logue's Chess-Coding-Adventures
- Rotated Bitboards pdf