Solve a Holy Knight's tour: Difference between revisions

Content added Content deleted
Line 2,470: Line 2,470:
const knightmoves = [[-2, -1], [-2, 1], [-1, -2], [-1, 2], [1, -2], [1, 2], [2, -1], [2, 1]]
const knightmoves = [[-2, -1], [-2, 1], [-1, -2], [-1, 2], [1, -2], [1, 2], [2, -1], [2, 1]]


board, empties, fixed, starts = hidatoconfigure(holyknight)
board, maxmoves, fixed, starts = hidatoconfigure(holyknight)
printboard(board, " 0", " ")
printboard(board, " 0", " ")
hidatosolve(board, knightmoves, fixed, starts[1][1], starts[1][2], 1, 1, empties + length(fixed))
hidatosolve(board, maxmoves, knightmoves, fixed, starts[1][1], starts[1][2], 1, 1)
printboard(board)
printboard(board)
</lang>{{output}}<pre>
</lang>{{output}}<pre>