Metadata-Version: 2.1
Name: jchess
Version: 0.101
Summary: Chess in the command line.
Project-URL: Homepage, https://j-hil@github.com/j-hil/cli-chess.git
Author-email: j-hil <92876062+j-hil@users.noreply.github.com>
License: GNU General Public License v3 (GPLv3)
License-File: LICENSE
Keywords: chess,console,terminal
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: colorama<1,>=0.4.5
Provides-Extra: dev
Requires-Dist: autoflake<2,>=1.7.7; extra == 'dev'
Requires-Dist: black<23,>=22.8.0; extra == 'dev'
Requires-Dist: coverage[toml]<7,>=6.5.0; extra == 'dev'
Requires-Dist: flake8-pyproject<2,>=1.2.0; extra == 'dev'
Requires-Dist: ipykernel<7,>=6.17.0; extra == 'dev'
Requires-Dist: isort<6,>=5.10.1; extra == 'dev'
Requires-Dist: mypy<1,>=0.971; extra == 'dev'
Requires-Dist: pre-commit<3,>=2.20.0; extra == 'dev'
Requires-Dist: pydocstringformatter<1,>=0.7.2; extra == 'dev'
Requires-Dist: pydocstyle[toml]<7,>=6.1.1; extra == 'dev'
Requires-Dist: pylint<3,>=2.15.2; extra == 'dev'
Requires-Dist: pytest<8,>=7.2.0; extra == 'dev'
Requires-Dist: types-colorama<1,>=0.4.15; extra == 'dev'
Description-Content-Type: text/markdown

# J-Chess: Play chess in the console!

[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)
[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)


<h1 align="center">
<img src="image.png" width="900">
</h1>

A simple project allowing you to play chess within your console.

## Usage

Requires `python 3.10`
or later. The package is available on `pypi` so to play simply install with
`pip install jchess` and then play with `jchess` or `python -m jchess`.

The project was developed primarily alongside `powershell` but the project should be
compatible with generic Windows and Linux consoles.

If you have any feedback please feel free to share it!

## Features

J-Chess fully implements chess logic and rules - including castling, en-passant, promotion and check/checkmate.

It is primarily designed to be played by 2 people at the same computer but it does
feature a "VS Dumb Bot" mode where you can play against an opponent who's moves are
random.

For demonstration purposes there is also a "Two Dumb Bots" mode where an entire game is
played with no user input.


## Motivation

This was simply a project to better familiarize myself with programming in python and
other lifecycle practices & tools.

I was able to practice using useful tools like `git`, `github` and `wsl` as well as
useful concepts including OOP programming patterns, regular expressions, testing,
documentation, packaging and managing dependencies.

The python tooling modules I used were:
| Utility          | Modules                                                             |
| ---------------- | ------------------------------------------------------------------- |
| Testing          | `pytest`, `coverage`                                                |
| Typing & linting | `mypy`, `pylint`, `flake8`, `pydocstyle`                            |
| Auto-formatting  | `black`, `isort`, `autoflake`, `pydocstringformatter`, `pre-commit` |

Python code features I experimented with and used in the final project include
dataclasses, generators, type annotations and context managers.

## Scope

The goal of the project was to practice pure python programming so by design there are
minimal 3rd party package dependencies - in fact there is only one: `colorama`.

The scope of the project was intentionally minimal, but some fun ideas if I return to
this project would be:
* Implementing different guis - maybe through a web app or `tkinter`
* Implement a genuine AI
* Implement a non-local multiplayer mode


## Project Structure

Not counting recursively, there are currently 8 sub-modules/packages which are
published in the `jchess` whl (plus one module used only for testing). The project
structure can be thought of as follows:

```
+-----------------------------------------------------+
|          pieces ---- board       display ------ run |
|         /                  \    /                   |
| geometry                    game                    |
|         \                  /    \                   |
|          terminal -- action      (testutils)        |
+-----------------------------------------------------+
```
