Skip to content

Commit 3b412c5

Browse files
committed
Fix order of files on flipped unicode board
1 parent 1909f1c commit 3b412c5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chess/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,12 +1239,12 @@ def unicode(self, *, invert_color: bool = False, borders: bool = False, empty_sq
12391239
builder.append(RANK_NAMES[rank_index])
12401240
builder.append(" ")
12411241

1242-
for file_index in range(8):
1242+
for i, file_index in enumerate(range(8) if orientation else range(7, -1, -1)):
12431243
square_index = square(file_index, rank_index)
12441244

12451245
if borders:
12461246
builder.append("|")
1247-
elif file_index > 0:
1247+
elif i > 0:
12481248
builder.append(" ")
12491249

12501250
piece = self.piece_at(square_index)

0 commit comments

Comments
 (0)