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.
- Install the package:
pip install cmd-game-chess
- 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:
- Clone the repository:
git clone https://github.com/Danil-gtj/cmd-chess.git
cd cmd-chess
- 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:
- 1 — Start Play: Enter the match against the AI.
- 2 — Save Game: Save your current board state.
- 3 — Load Game: Resume from your last save.
- 4 — Toggle Graphics: Switch between Unicode icons and ASCII letters (useful if figures appear as squares).
- 0 — Exit: 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f4b7610bede21eb5f96704d45730d35b6fad88bc5d90b902e4451d5efb39434
|
|
| MD5 |
82b279ddbbeb01950dc842779b85ff47
|
|
| BLAKE2b-256 |
2d1e151a1411ab8e0f973b4722c338108447b7f93c4c4fb64af2ae7e7dd79dd9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4038b4b83c40b995d040d18a3fd9c4fbc490ac23dc9d419730cd95e2b70f8388
|
|
| MD5 |
b3b4b276c0cb94e87e780a5974e866c8
|
|
| BLAKE2b-256 |
4c0e99ff625b38eae5d781b370d38f12cc85f251adbffec90b9f70315a1a5cb5
|