From d4a9528127d5e192ed9ef7c6282ed906fb88bc34 Mon Sep 17 00:00:00 2001 From: Tibor Bizjak Date: Tue, 10 Sep 2019 18:47:34 +0200 Subject: [PATCH] Changed Piece string repr --- chess.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chess.py b/chess.py index a65cdd7..d17b385 100644 --- a/chess.py +++ b/chess.py @@ -103,10 +103,13 @@ class Piece: def __repr__(self): if None in (self.piece, self.color): - return None + return "" name = self.color.upper() + " CHESS " + self.piece.upper() return lookup(name) + def __str__(self): + return repr(self) + def __eq__(self, other): if other == None: return None in (self.color, self.piece) @@ -426,4 +429,3 @@ def test(): continue print(game) -test()