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, |
board, maxmoves, fixed, starts = hidatoconfigure(holyknight) |
||
printboard(board, " 0", " ") |
printboard(board, " 0", " ") |
||
hidatosolve(board, knightmoves, fixed, starts[1][1], starts[1][2], 1, 1 |
hidatosolve(board, maxmoves, knightmoves, fixed, starts[1][1], starts[1][2], 1, 1) |
||
printboard(board) |
printboard(board) |
||
</lang>{{output}}<pre> |
</lang>{{output}}<pre> |