Skip to content

Commit 77f1dab

Browse files
authored
Merge pull request #1190 from kraktus/variation_san_black_space
variation_san, include a space after the ellipsis for black moves
2 parents b53c6e6 + 87698c8 commit 77f1dab

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

chess/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3194,7 +3194,7 @@ def variation_san(self, variation: Iterable[Move]) -> str:
31943194
"""
31953195
Given a sequence of moves, returns a string representing the sequence
31963196
in standard algebraic notation (e.g., ``1. e4 e5 2. Nf3 Nc6`` or
3197-
``37...Bg6 38. fxg6``).
3197+
``37... Bg6 38. fxg6``).
31983198
31993199
The board will not be modified as a result of calling this.
32003200
@@ -3210,7 +3210,7 @@ def variation_san(self, variation: Iterable[Move]) -> str:
32103210
if board.turn == WHITE:
32113211
san.append(f"{board.fullmove_number}. {board.san_and_push(move)}")
32123212
elif not san:
3213-
san.append(f"{board.fullmove_number}...{board.san_and_push(move)}")
3213+
san.append(f"{board.fullmove_number}... {board.san_and_push(move)}")
32143214
else:
32153215
san.append(board.san_and_push(move))
32163216

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ def test_variation_san(self):
779779
self.assertEqual(fen, board.fen(), msg="Board unchanged by variation_san")
780780
board.push(chess.Move.from_uci(variation.pop(0)))
781781
var_b = board.variation_san([chess.Move.from_uci(m) for m in variation])
782-
self.assertEqual(("19...Kxh7 20. Qh5+ Kg8 21. Rg3 Bf8 22. Bg5 Re7 "
782+
self.assertEqual(("19... Kxh7 20. Qh5+ Kg8 21. Rg3 Bf8 22. Bg5 Re7 "
783783
"23. Bf6 Nd7 24. Qh6 Nxf6 25. exf6 g6 26. fxe7 Bxe7"),
784784
var_b)
785785

0 commit comments

Comments
 (0)