本文整理匯總了Python中Solver.getCarArray方法的典型用法代碼示例。如果您正苦於以下問題:Python Solver.getCarArray方法的具體用法?Python Solver.getCarArray怎麽用?Python Solver.getCarArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Solver
的用法示例。
在下文中一共展示了Solver.getCarArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: nextMove
# 需要導入模塊: import Solver [as 別名]
# 或者: from Solver import getCarArray [as 別名]
def nextMove(board):
cars = Solver.getCarArray(board)
solution = Solver.solve(board, cars)
mvs = []
mvs.append(solution[0])
while solution[1] != ():
solution = solution[1]
mvs.append(solution[0])
board.incrementMoves()
mvs.pop() # Get rid of first move (no change).
Solver.updateBoard(board, mvs.pop())
board.clearBoard()
board.drawGrid()
board.drawCars()
board.master.update()
board.checkForWin()