15 puzzle solver: Difference between revisions

Content added Content deleted
No edit summary
Line 1:
{{draft task|Games}}
Your task is to write a program that solvesfinds a solution in the fewest moves possible to a random [[wp:15_puzzle|Fifteen Puzzle Game]] in the fewest number of moves.<br />
For this task you will be using the following puzzle:<br />
<pre>15 14 1 6
Line 11:
5 6 7 8
9 10 11 12
13 14 15 0</pre>
</pre>
 
The output must show the moves' directions, like so: left, left, left, down, right... and so on.<br />
;Extra credit.
Solve the following problems:
<pre>
2 1 3 4
5 6 7 8
9 10 11 12
13 14 15 0
</pre>
and
<pre>
0 12 9 13
15 11 10 14
3 7 2 5
4 8 6 1
</pre>
=={{header|C++}}==
===The Solver===