Skip to main content

A simple command-line chess game!

Project description

CMD Chess Game ♟️

      __   __   __
    /   \/   \/   \
   | v   v   v   v |
    \  \   .   /  /
     \__\_/_\_/__/
     |           |
     |( ) ( ) ( )|
     |___________|
          ___
         (   )
          ) (
         /   \
        (     )
         )   (
        /     \
       (_______)

A lightweight, cross-platform terminal-based chess game written in Python. Play against a positional AI right in your command line!

Features

  • Cross-Platform: Automatic rendering for Windows (ASCII/Unicode) and Linux/macOS.
  • Smart AI: An integrated chess bot with positional evaluation.
  • Input Validation: Robust error handling for illegal moves and non-numeric menu inputs.
  • Easy Installation: Fully compatible with pip and PyPI.
  • Save/Load System: Support for saving your game state to resume later.

Installation

Install via pip:

You can install the game directly from PyPI. Ensure you have Python 3.10 or higher installed.

  1. Install the package:
pip install cmd-game-chess
  1. Run the game:
play-chess

Note: If the command play-chess is not found, use python -m cmd_chess.chess.*

Run from Source:

If you want to contribute or modify the code:

  1. Clone the repository:
git clone https://github.com/Danil-gtj/cmd-chess.git
cd cmd-chess
  1. Launch the script:
python src/cmd_chess/chess.py

Arch Linux (AUR):

For Arch Linux users, the package is available in the AUR:

yay -S python-cmd-game-chess

How to Play

Menu Controls:

Enter the corresponding number to navigate:

  • 1Start Play: Enter the match against the AI.
  • 2Save Game: Save your current board state.
  • 3Load Game: Resume from your last save.
  • 4Toggle Graphics: Switch between Unicode icons and ASCII letters (useful if figures appear as squares).
  • 0Exit: Close the application.

In-Game Commands:

  • Move pieces using standard coordinates (e.g., A2 to A4).
  • Type EXIT at any time during your turn to return to the main menu.

Technical Details:

  • Dependencies: None (Uses Python Standard Library only).
  • Architecture: Modular structure with dedicated logic for piece movement, AI evaluation, and state persistence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmd_game_chess-0.1.4.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmd_game_chess-0.1.4-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file cmd_game_chess-0.1.4.tar.gz.

File metadata

  • Download URL: cmd_game_chess-0.1.4.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cmd_game_chess-0.1.4.tar.gz
Algorithm Hash digest
SHA256 632c758fa4b876b97d1a6c1005e4679540a6b13b4a6bb55b97711e3c92516917
MD5 78c6250dc1a96f88b7fa145dd205651f
BLAKE2b-256 630b6d389f2e18ad8847455e012a6e7f5114b9c5dc7d614c0000d6ded1925207

See more details on using hashes here.

File details

Details for the file cmd_game_chess-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cmd_game_chess-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cmd_game_chess-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c4bb2b021b13b6b049980c29efa5273927ad8e51262f5ca3358306dde9911245
MD5 8d74642f62a3d228355464adb1e3fcaa
BLAKE2b-256 0e3a146d543e569d2c8644890e407ae9976366f8ca0a2a0860ee9da89e04b620

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page