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.5.tar.gz (9.8 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.5-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmd_game_chess-0.1.5.tar.gz
  • Upload date:
  • Size: 9.8 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.5.tar.gz
Algorithm Hash digest
SHA256 4f4b7610bede21eb5f96704d45730d35b6fad88bc5d90b902e4451d5efb39434
MD5 82b279ddbbeb01950dc842779b85ff47
BLAKE2b-256 2d1e151a1411ab8e0f973b4722c338108447b7f93c4c4fb64af2ae7e7dd79dd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmd_game_chess-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4038b4b83c40b995d040d18a3fd9c4fbc490ac23dc9d419730cd95e2b70f8388
MD5 b3b4b276c0cb94e87e780a5974e866c8
BLAKE2b-256 4c0e99ff625b38eae5d781b370d38f12cc85f251adbffec90b9f70315a1a5cb5

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