Skip to main content

A minimalistic python terminal-chess application

Project description

terminal-chess

A python based terminal chess application. Uses ANSI escape sequences to print board squares and clear the screen – for reprinting. Visual UI likely to vary based on terminal and terminal settings/preferences.

A screenshot of the starting game board Initial game board, waiting for first player's input

Input to this application is standard algebraic notation. Long/fully-expanded algebraic notation, ICCF numeric notation, PGN, minimal/abbreviated algebraic notation are not supported yet, but may be in the future.

Bug/Issue Reporting

Submit these to Github issues.

Some things to keep in mind:

  1. Prevent duplicates - search existing open and even closed issues before submitting
  2. Rule out local issues - could this be an issue with your terminal/settings/preferences?
  3. Provide steps to reproduce - e.g. if this is a bug in chess logic, provide the input that produces the bug
  4. Provide environment details - if applicable, provide information like OS, terminal emulator, python version, terminal settings/preferences
  5. Be respectful - this is a place for fun and collaboration :) keep it clean and respectful

Failure to follow these may result in your issue/bug report being immediately closed or ignored until the relevant details are provided.

Feature Requests

Submit these to Github issues. Please consider that this project is being worked on in the maintainer's free time so you are much more likely to have your feature if you make it yourself! See Development. Please cross-reference your feature request with items In Development which have already been considered and likely to be picked up at some point.

In Development

These are some of the items that have been thought of as potential next features/improvements to the current implementation. This list does not necessarily guarantee that the feature will ever be implemented but they have been considered.

  1. General refactoring of the logic, initial implementation was done as a quick MVP focusing on correctness and not maintainability or future development. This is a high priority item.
  2. Better UI/UX: this includes listing the moves already played, the pieces captured per player, an option to flip the board display each turn, better help messages, etc.
  3. Serialization and ability to save/continue a game
  4. Draws/surrenders
  5. Turn/game clock and different game modes like bullet, etc.
  6. A hardy test suite
  7. Allow other input notations and support formats like PGN
  8. A simple AI

Writing a network module is something that I want to do but will take significant effort. It's on the long-term roadmap though.

Development

Submit pull requests to Github. This project utilizes pipenv for development. Run pipenv shell to create and activate the virtual environment and use pipenv install --dev to install the necessary development dependencies.

  • Start python virtual environment
/project-root> pipenv shell
  • Install development dependencies
/project-root> pipenv install --dev

Please use flake8 to handle linting issues before submitting PRs. This includes linting for test files.

  • Run linter
/project-root> flake8

Please run tests to ensure nothing was broken. Also, write tests for your changes if applicable.

  • Run tests
/project-root> pytest

If you want to install the package to validate the script.

  • Install terminal-chess package
/project-root> pip install .
  • Run game from script after install
/project-root> pychess

Tenets

A list of tenets that this project goes by:

  1. Avoid unnecessary dependencies - this is a relatively minimal implementation of chess for the terminal
  2. Maintainable and expandable - changes over time should promote and make future development easier & reduce tech debt; this includes linting, sufficient testing, and using proper design patterns
  3. Avoid boilerplate/setup hell - avoid any changes that complicate future development or further restrict useable environments to run/develop on
  4. Open source - engage the community and promote collaboration on this project

License

terminal-chess is published under the MIT license; see LICENSE.

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

terminal-chess-0.0.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

terminal_chess-0.0.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file terminal-chess-0.0.2.tar.gz.

File metadata

  • Download URL: terminal-chess-0.0.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for terminal-chess-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c293c10a648a7846ce5825cfe5b9745c86649449ed7f7af4b87054792c1041d2
MD5 c1a6f6cbdde92a44753a93a8402ad8ca
BLAKE2b-256 519957f165f69b40a5f4439056b95b66581f24940f9c418e8bc6476a9a792bf7

See more details on using hashes here.

File details

Details for the file terminal_chess-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: terminal_chess-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for terminal_chess-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a2e59d3242ecf8fcb73510328aa21d543acc9d26eb4f853b71b8d57ee0818696
MD5 521bc18f75032eb7e63479abcba98f92
BLAKE2b-256 f34f8be727ec3843dee96ab79db18e3d4d213b10c27e64f4fe44bdef0675b209

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