This repository contains a custom chess engine built from scratch in Python.
The project focuses on implementing the core mechanics of chess, including board representation, move generation, and rule validation, without relying on external chess engines or libraries.
The engine is designed to be clear, extensible, and easy to reason about, prioritizing correctness and learning over performance.
The main goal of this project is to:
- understand how a chess engine works internally
- implement chess rules explicitly and transparently
- maintain full control over the game state and logic
- build a solid foundation for future experimentation
At its current stage, the project is purely a chess engine, with no AI or ML decision-making involved.
- 8×8 board representation using enums
- Deterministic board state management
- Point-and-click piece selection and movement
- Legal move generation per piece
- Sliding piece movement with obstacle detection
- Separation between game logic and rendering
The board matrix is the single source of truth for the game state.
Implemented:
- Board initialization
- Piece placement
- Piece selection
- Basic move validation
- Legal movement logic for all pieces
- Captures with entity removal
- Check and checkmate detection
- Castling
- En passant
- Pawn promotion
In future iterations, the engine will be extended with a position evaluation system based on Machine Learning.
Planned direction:
- Use the current board representation as model input
- Train a neural network to evaluate positions
- Integrate evaluation into move selection and analysis
The ML component will be built on top of the existing engine, without modifying the core game logic.
This project is a work in progress, intended for learning, experimentation, and incremental improvement.
The current focus is on building a correct and reliable chess engine core before introducing any form of automated evaluation.
MIT License