Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ The generated positions are random, which is different to Lichess' presets.

```text
$ chessg
╭────────────────────────── Piece Input ──────────────────────────╮ ╭────────── Commands ──────────╮
│ Generate chess positions and practise on Lichess. │ │ h Help │
│ │ │ Enter Use previous input │
│ Provide the symbols of the pieces to place on the board. White │ │ Ctrl+D Quit │
│ pieces are P, N, B, R, Q, black pieces are p, n, b, r, q. Kings │ ╰──────────────────────────────╯
│ are automatically added and must not be part of the input. │
│ You can separate piece symbols by commas and/or spaces. │
│ │
│ Examples: │
│ │
│ Qr - queen against rook │
│ R, p, p - rook against two pawns │
│ N B B q - knight and two bishops against a queen │
│ │
╰─────────────────────────────────────────────────────────────────╯
╭──────────────────── Piece Input ────────────────────╮ ╭────────── Commands ──────────╮
│ Generate chess positions and practise on Lichess. │ │ h Help │
│ │ │ Enter Use previous input │
│ Provide the symbols of the pieces to place on the │ │ Ctrl+D Quit │
│ board. White pieces are P, N, B, R, Q, black pieces │ ╰──────────────────────────────╯
│ are p, n, b, r, q. Kings are automatically added │
│ and must not be part of the input. You can separate │
│ piece symbols by commas and/or spaces. │
│ │
│ Examples: │
│ │
│ Qr - queen against rook │
│ R, p, p - rook against two pawns │
│ N B B q - knight and two bishops against a queen │
│ │
╰─────────────────────────────────────────────────────╯
Position: BN
. . . k . . . .
. . . . . . . .
Expand All @@ -38,6 +39,23 @@ Position (enter = BN): ^D
Bye!
```

You can set the initial piece configuration directly in the command line:

```text
$ chessg Qr
[...]
. . . . . . . .
. . . . . . . .
. . . . . . . r
. . . . . . . .
. . . . . . Q .
k . . . . . . .
. . . . . . . .
. K . . . . . .
https://lichess.org/?fen=8/8/7r/8/6Q1/k7/8/1K6%20w%20-%20-%200%201#ai
Position (enter = Qr):
```

## Installation

```shell
Expand Down
11 changes: 6 additions & 5 deletions chess_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from rich.panel import Panel
from rich.table import Table

__version__ = "1.2.1"
__version__ = "1.2.2"

WHITE_PAWN = Piece.from_symbol("P")
BLACK_PAWN = Piece.from_symbol("p")
Expand All @@ -25,10 +25,11 @@
HELP: Final[str] = """\
Generate chess positions and practise on Lichess.

Provide the symbols of the pieces to place on the board. White
pieces are P, N, B, R, Q, black pieces are p, n, b, r, q. Kings
are automatically added and must not be part of the input.
You can separate piece symbols by commas and/or spaces.
Provide the symbols of the pieces to place on the
board. White pieces are P, N, B, R, Q, black pieces
are p, n, b, r, q. Kings are automatically added
and must not be part of the input. You can separate
piece symbols by commas and/or spaces.

Examples:

Expand Down
Loading