15 puzzle solver: Difference between revisions

Content added Content deleted
Line 162:
}
let n = Seq.collect fN n
match (Seq.tryFind(fun(_,_,n,_,_)->n=1311768467463790320UL0x123456789abcdef0UL)) n with
|Some(_,_,_,n,_) -> printf "Solution found with %d moves: " (List.length n); List.iter (string >> printf "%s") (List.rev n); printfn ""
|_ -> Solve (Seq.filter(fun (_,_,_,_,n)->not n) n)
Solve [(2,0,18308992086016514130UL0xfe169b4c0a73d852UL,[],false)]
</lang>
{{out}}
Line 172:
</pre>
see: [http://www.rosettacode.org/wiki/15_puzzle_solver/Optimal_solution Pretty Print of Optimal Soltion]
 
=={{header|Phix}}==
{{incorrect|Phix|The task calls for a solution in the fewest moves which is 52 not 58}}