💾 Archived View for kenogo.org › literate_programming › 15_puzzle_solver.gmi captured on 2023-09-08 at 16:05:54. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
The 15 puzzle is a game where 15 numbered square tiles are arranged on a 4 x 4 grid. They can be moved to fill the empty square. The objective of the game is to arrange the tiles so that they are in order:
+----+----+----+----+ | 1 | 2 | 3 | 4 | +----+----+----+----+ | 5 | 6 | 7 | 8 | +----+----+----+----+ | 9 | 10 | 11 | 12 | +----+----+----+----+ | 13 | 14 | 15 | | +----+----+----+----+
This program takes a given board constellation as its input and returns the moves required to solve it in the least number of moves. It is written using noweb.