How to programmatically solve the 15 (moving numbers) puzzle?

后端 未结 7 1792
礼貌的吻别
礼貌的吻别 2021-02-04 08:02

all of you have probably seen the moving number/picture puzzle. The one where you have numbers from 1 to 15 in a 4x4 grid, and are trying to get them from random starting positi

7条回答
  •  走了就别回头了
    2021-02-04 08:36

    There are always up to 4 move positions from any given one. I wonder whether the simple algorithm that goes over all options building 2-4 tree will reach the "solved" position or the stack overflow :)

提交回复
热议问题