Well, I code for these problems, just rudely forcing it. create a way to enter what the panel looks like (where the rectangles are and their orientation), then write a recursive function that goes into all possible movements. Not difficult, theoretically;) Note that the board is 6x6, and do not forget to make a way for the program to output every move. Maximum EDIT: After thinking about this for a while, you should figure out which block keeps the red block from moving to the right, and then figure out which direction it should go (there can only be a vertical block). If it is high 3, the block should lower, otherwise create a fork in the recursive function and check what happens if the block moves in any direction. Then find out which block blocks the last block until nothing is blocked. This is an opportunity.
source share