Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @staticmethod
- def _recursive_build(tree_node, s, paths):
- map = tree_node['map']
- moves = map.get_moves()
- for move in moves:
- map_copy = deepcopy(map)
- map_copy.move(move)
- string = AI_Player._map_core_to_str(map_copy.get_core())
- if string in s:
- continue
- tree_node['children'].append( { 'map' : map_copy, 'path' : tree_node['path'] + move[2], 'children' : [] } )
- s.add(string)
- for child in tree_node['children']:
- if child['map'].has_ended():
- paths.append(child['path'])
- continue
- AI_Player._recursive_build(child, s, paths)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement