def dumps(self): """ Returns game as standard notation string """ out = [] for move in self.moves: out.append(move.dumps()) return '/'.join(out)
def valid_move(self, move): """ Determines if move can be played on the current game state """ moves = self.get_valid_moves() notation = move.dumps() for m in moves: if m == notation: return True return False