I still don't quite understand the coding of the walls. In the first test case, you can only move in the fifth dimension. However, the binary coding of all the positions except the last was 15 ('01111'), which, to my understanding, forbids movement in all directions except for the first dimension. Therefore you will always be trapped in the initial position, because the only dimension (i.e. the fifth) is forbidden. Please tell me where I got wrong, thanks!!!