Changed Piece string repr
parent
f9431d8add
commit
d4a9528127
6
chess.py
6
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()
|
||||
|
|
Loading…
Reference in New Issue