The input says numbers from "1 to 8", where as it actually is "0 to 8". Besides that the example code shows a 15-puzzle.
1
3
7