Skip to content

amagrabi/chess2

Repository files navigation

Chess 2

Demo

The last patch for chess was probably shipped over 100 years ago, so it's time for some improvements:

  • Knights can now jump in all directions, because real horses stopped using L-shaped movement centuries ago.
  • Stalemate is no longer a draw. If you can't move, that's a you problem and your opponent gets another turn.
  • Ėń pãşšãñţ has been disabled, so nobody ever has to spell it again.
  • Added a new piece on h2/h7, the spy. Moves in sneaky L-shapes, but converts enemy pieces instead of capturing them. Can only convert once and dies in the process.
  • Bishops can no longer capture queens. Just doesn't seem right.
  • Fixed a bug where computers were better at chess than humans.
  • Pawns can now move and capture both forwards and diagonally, like normal people. But they still can't move backwards. That would be ridiculous.

Installation

Option 1: Executables

Executables for macOS and Windows can be found under releases.

Option 2: Python

Create and activate a virtual environment, for example via uv:

uv venv
source .venv/bin/activate

Install dependencies in editable mode:

uv pip install -e .

Start game:

chess2

Option 3: Docker (experimental)

Setup is still error-prone, because pygame and Docker aren't best friends.

Requirements: Install XQuartz (Mac) or Xming (Windows).

Build and start the Docker container:

docker-compose build
docker-compose up

Development

Install dev dependencies:

uv pip install -e ".[dev]"

Install pre-commit hooks for auto-formatting:

pre-commit install

Run tests:

pytest tests/

Creating macOS/Windows executables into /dist for releases:

pyinstaller chess2.spec

About

Long-overdue patch for chess.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors