Skip to content

0Reab/Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess

Chess built from scratch in Python, OOP style. Has a web backend & frontend served locally.

screenshot

Structure

Chess/
├── game.py      # game loop, move validation, turn management
├── board.py     # board, files, diagonals, path logic
├── pieces.py    # piece types and properties
├── squares.py   # square model + notation
├── tests.py     # tests
└── server/      # local web server + HTML/CSS/JS frontend

Usage

git clone https://github.com/0Reab/Chess.git
cd Chess
activate venv
cd server
python -m app

Then open http://localhost:<port> in your browser.

Implemented

  • Move validation for all pieces
  • Check, double check, pins
  • Castling (with checks-through-path validation)
  • Pawn promotion (queen only)
  • Web UI rendered from White's perspective

TODO

  • En passant
  • Stalemate detection
  • Draw conditions (50-move, threefold repetition, etc.)
  • Promotion choice (currently always queens)
  • Game over screen
  • Matchmaking via code
  • Security auditing :)

Thank you

To Lichess and Randall Munroe (xkcd) for the Chess pieces graphics set!

About

Implementing Chess in Python from scratch in OOP style

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors