💾 Archived View for kenogo.org › literate_programming › 15_puzzle_solver.gmi captured on 2024-06-16 at 12:29:29. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

15 Puzzle Solver

Homepage

Literate programming

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.

15_puzzle_solver.pdf

15_puzzle_solver.nw

15puzzle_solver.c