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!" ), "Invalid buttons!"
def __str__(self) -> str: def __str__(self) -> str:
result = "\n".join(self.rows) return "\n".join(self.rows) \
result = result\ .replace("0", "⚪️") \
.replace("0", "⚪️")\ .replace("1", "🟢️") \
.replace("1", "🟢️")\
.replace("x", "⚫️") .replace("x", "⚫️")
return result
@property @property
def columns(self) -> tuple[str, ...]: def columns(self) -> tuple[str, ...]: