Skip to content

RyoK3N/Chess-RLA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Chess AI Project

This project demonstrates a simple reinforcement learning agent that learns to play chess through self‑play.

Setup

  1. Create a Python virtual environment.
  2. Install dependencies:
    pip install -r requirements.txt

Training

Run the training script to let the agent learn by self-play:

python -m chess_ai.train --episodes 1000 --checkpoint agent.pth

This will store a model checkpoint at agent.pth.

Play against the AI

After training, you can play against the agent either in the terminal or using the graphical interface.

Terminal UI

python -m chess_ai.play_ui --model agent.pth

Moves are entered in UCI notation (e.g., e2e4).

Pygame UI

python -m chess_ai.play_pygame --model agent.pth

When a piece is selected, the square is highlighted and all legal target squares are marked. Click a highlighted square to move the piece. The AI will then make its move in response.

Repository Structure

  • chess_ai/ – Package containing the environment, agent, and scripts
    • assets/svg/ – SVG icons for chess pieces
    • play_pygame.py – interactive Pygame interface
    • play_ui.py – terminal interface
    • train.py – training entry point
  • requirements.txt – Project dependencies
  • README.md – Project overview and instructions

About

A simple RL agent that plays chess

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages