refactor Board.__str__()

This commit is contained in:
Jörn-Michael Miehe 2023-08-20 16:34:12 +00:00
parent 9c00dd61a4
commit 63596fae3c

View file

@ -46,12 +46,10 @@ class Board:
), "Invalid buttons!"
def __str__(self) -> str:
result = "\n".join(self.rows)
result = result\
.replace("0", "⚪️")\
.replace("1", "🟢️")\
return "\n".join(self.rows) \
.replace("0", "⚪️") \
.replace("1", "🟢️") \
.replace("x", "⚫️")
return result
@property
def columns(self) -> tuple[str, ...]: