cc

cl-chess

A python program to play chess against an AI in the terminal.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

392

Maintenance

Last Commit

2mos ago

Contributors

9

Package

Dependencies

1

License

Categories

Readme

Run on Repl.it

command-line-chess

A python program to play chess against an AI in the terminal.

Also check out my other project, a program to practice chess tactics.

Installation

Requires Python 3, run the following to install :

pip3 install cl-chess

Usage

Run the following command after installation

chess

Type '?' to get help at any time during the game.

You'll be asked to choose between playing as white or black, and what depth you want the AI to search :

Initial

You can then make any (legal) move :

First move

Options

Instead of a move, you can input :

  • l to see every legal move
  • r to make a random move
  • u to undo your last move

Technical stuff

The AI is a simple brute-force AI with no pruning. It evaluates a given position by counting the value of the pieces for each side (pawn -> 1, knight/bishop -> 3, rook -> 5, queen -> 9). It will evaluate the tree of moves, and take the path that results in the greatest gain. To learn more, check out my post on how it works.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100