From 00b0b4684e0588a6800c7d16cfd1e8627c6684f7 Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:43:27 +0100 Subject: [PATCH 1/6] Make help message narrower --- chess_gen.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chess_gen.py b/chess_gen.py index 40afda2..27aaa62 100644 --- a/chess_gen.py +++ b/chess_gen.py @@ -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: From a042b9a53244a7291c58619618367f2ec2986347 Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:46:35 +0100 Subject: [PATCH 2/6] Update README --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4199f1f..e5edb1a 100644 --- a/README.md +++ b/README.md @@ -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 board. │ │ Ctrl+D Quit │ +│ 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 . . . . . . . . . . . . From 4a3df1022e267122f4a22f9aa83f0e00e29cfae2 Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:46:52 +0100 Subject: [PATCH 3/6] Bump version --- chess_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chess_gen.py b/chess_gen.py index 27aaa62..e3301a4 100644 --- a/chess_gen.py +++ b/chess_gen.py @@ -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") From a8ae4da37d6ec2cd3ecb0c0adce182173dfaa1eb Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:48:20 +0100 Subject: [PATCH 4/6] Max text even more narrow --- chess_gen.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chess_gen.py b/chess_gen.py index e3301a4..b78b789 100644 --- a/chess_gen.py +++ b/chess_gen.py @@ -25,11 +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: From 5fe43f59f793ff22d10afdf73c0e94ef86f91f8e Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:49:07 +0100 Subject: [PATCH 5/6] Update README --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e5edb1a..e289f19 100644 --- a/README.md +++ b/README.md @@ -9,22 +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. │ │ Ctrl+D Quit │ -│ 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 │ -│ │ -╰──────────────────────────────────────────────────────────╯ +╭──────────────────── 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 . . . . . . . . . . . . From 994122c5a02dff4d47dc57978ba0f6ccf6c5a5c6 Mon Sep 17 00:00:00 2001 From: Stanislv Schmidt Date: Sat, 22 Feb 2025 19:52:22 +0100 Subject: [PATCH 6/6] Add command line usage example to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e289f19..7e83ab7 100644 --- a/README.md +++ b/README.md @@ -39,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