Skip to content

Commit

Permalink
Fix order of files on flipped unicode board
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Jul 29, 2022
1 parent 1909f1c commit 3b412c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,12 +1239,12 @@ def unicode(self, *, invert_color: bool = False, borders: bool = False, empty_sq
builder.append(RANK_NAMES[rank_index])
builder.append(" ")

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

if borders:
builder.append("|")
elif file_index > 0:
elif i > 0:
builder.append(" ")

piece = self.piece_at(square_index)
Expand Down

0 comments on commit 3b412c5

Please sign in to comment.