Introduction - If you have any usage issues, please Google them yourself
The algorithm of the shortest number of steps, the most primitive version of the jigsaw puzzle, the first time, the middle of the next button is to calculate the return to the accident the steps of the state. After each time you press, then backwards to go back (at least the number of steps). Code, comments, and operating results in Figure.