def level3(file_path): """Find the shortest path between the start and end positions""" start = (1, 1) end = (6, 6) # Set starting point board = Board(file_path, 8) board.set_knight_location(start) mover = Mover(board) path = mover.find_shortest_path(start, end) print path mover.move(path, display=True)
def level4(file_path): """Find the shortest path between the start and end of the 32x32 weighted board, with additional constraints """ start = (1, 1) end = (26, 25) board = Board(file_path, 32) board.set_knight_location(start) mover = Mover(board) path = mover.find_shortest_path(start, end) print path mover.move(path, display=True)