本文整理汇总了Python中maze.Maze.parse方法的典型用法代码示例。如果您正苦于以下问题:Python Maze.parse方法的具体用法?Python Maze.parse怎么用?Python Maze.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maze.Maze
的用法示例。
在下文中一共展示了Maze.parse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from maze import Maze [as 别名]
# 或者: from maze.Maze import parse [as 别名]
height = int(raw_input('Height: '))
# Find nearest vertex to begin with
start = estimate_current_vertex(width, height)
m = detect_maze(start, width, height)
print 'Maze detected!'
name = raw_input('File name: ')
with open(name, 'w') as f:
f.write(repr(m))
print 'String representation saved.'
elif answer.upper() == 'B':
name = raw_input('File name: ')
with open(name, 'r') as f:
s = f.read()
m.parse(s)
start = raw_input('Starting point (input format is "x,y"): ')
finish = raw_input('Finish (input format is "x,y"): ')
s = start.partition(',')
f = finish.partition(',')
a = (int(s[0]), int(s[2]))
b = (int(f[0]), int(f[2]))
path = m.bfs(a, b)
run(path, m)