N-puzzle and solver