def __repr__(self): B = np.copy(self.gameState).astype(object) for n, p in SYMBOLS.iteritems(): B[B == n] = p return repr(B)
def winner(self): for p in filter(lambda p: p != 0, SYMBOLS.iterkeys()): if self.is_win(p): return p return None