Skip to content

C-JeanDev/CustomChessEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♟️ Custom Chess Engine (Python)

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.


🎯 Project Goal

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.


♟️ Core Features

  • 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.


Screenshot from 2026-02-02 20-53-05

🧩 Current Scope

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

🔮 Future Work: Machine Learning Evaluation

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.


🧑‍💻 Status

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.


📜 License

MIT License

About

A custom-built chess engine written in Python, featuring a handcrafted game core and a neural-network-based evaluation function trained on PGN games

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages