Add convenience 'Square' constructor in GDB utils

This commit is contained in:
Bruno BELANYI 2024-04-01 14:37:37 +01:00
parent 83a29cae2a
commit a1005c1bec

View file

@ -14,6 +14,10 @@ class Square(object):
def __init__(self, val):
self._val = val
@classmethod
def from_file_rank(cls, file, rank):
return cls(file * 8 + rank)
def __str__(self):
return self.FILES[self.file] + self.RANKS[self.rank]