Esempio n. 1
0
 def __init__(self, moves):
   """ Creates a game state based on the supplied move list
   
   moves: a string of a game state in standard notation
   """
   
   from square import Square
   self.squares = []
   for i in range(9): self.squares.append(Square(self, i+1))
   from parse import Parse
   moves = Parse.moves(moves)
   self.moves = []
   for move in moves: # Play through supplied moves
     self.step(move)
Esempio n. 2
0
    def __init__(self, moves):
        """ Creates a game state based on the supplied move list
    
    moves: a string of a game state in standard notation
    """

        from square import Square
        self.squares = []
        for i in range(9):
            self.squares.append(Square(self, i + 1))
        from parse import Parse
        moves = Parse.moves(moves)
        self.moves = []
        for move in moves:  # Play through supplied moves
            self.step(move)