15 puzzle solver: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "{{draft task|Games}} Your task is to write a programm that solves the Fifteen Puzzle Game in the fewest number of moves.<br /> For this task you will be using...")
 
No edit summary
Line 7: Line 7:
13 8 5 2</pre>
13 8 5 2</pre>
<br />
<br />
Solution:<pre>
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 0</pre>

The output must show the moves' directions, like so: left, left, left, down, right... and so on.<br />
The output must show the moves' directions, like so: left, left, left, down, right... and so on.<br />
Show this output on this page.
Show this output on this page.

Revision as of 09:41, 10 July 2017

15 puzzle solver is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Your task is to write a programm that solves the Fifteen Puzzle Game in the fewest number of moves.
For this task you will be using the following puzzle:

15 14  1  6
 9 11  4 12
 0 10  7  3
13  8  5  2


Solution:

 1  2  3  4
 5  6  7  8
 9 10 11 12
13 14 15  0

The output must show the moves' directions, like so: left, left, left, down, right... and so on.
Show this output on this page.