本文整理汇总了Python中Solver.Solver.moves方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.moves方法的具体用法?Python Solver.moves怎么用?Python Solver.moves使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver.Solver
的用法示例。
在下文中一共展示了Solver.moves方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Board
# 需要导入模块: from Solver import Solver [as 别名]
# 或者: from Solver.Solver import moves [as 别名]
from Solver import Solver
from Board import Board
if __name__ == '__main__':
## No solucionables:
#board = Board([[1,2,3],[4,5,6],[8,7,0]])
## Se desfazan en numero de pasos:
#board = Board([[7,2,4],[5,0,6],[8,3,1]])
#board = Board([[6,0,5],[8,7,4],[3,2,1]])
board = Board([[8,6,7],[2,5,4],[3,0,1]])
## Solucionables de inmediato:
#board = Board([[0,2,3],[1,4,6],[7,5,8]]) #4
#board = Board([[1,8,2],[0,4,3],[7,6,5]]) #10
#board = Board([[0,1,3],[4,2,5],[7,8,6]]) #5
solver = Solver(board)
print 'board:\n'
print board
print '\nsolution\n'
print solver.moves()
##Take care of:
#print len(solver.close)
#print len(solver.opened)
#print board
#for i in board.neighbors():
# print i