From 63596fae3cb892916f3a2010b8a1d6c65772033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 20 Aug 2023 16:34:12 +0000 Subject: [PATCH] refactor Board.__str__() --- pigeon_magnet_solver/board.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pigeon_magnet_solver/board.py b/pigeon_magnet_solver/board.py index 649c58a..b195f41 100644 --- a/pigeon_magnet_solver/board.py +++ b/pigeon_magnet_solver/board.py @@ -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, ...]: