# How to swap position of two elements when you can only rearrange four of them by one-way rotation?

The following puzzle is the final puzzle in the video game "Grim Tales: The Bride". Is there a methodical way of solving this type of puzzle? Can I plan steps to swap the position of the red hexagon and the red square without screwing up the rest of the elements, as shown in the picture?

The rules are:

• You have to align the pieces horizontally by color
• You have to align the pieces vertically by symbol
• You can only rotate four of the pieces clockwise at a time
• Reminds me of this even though it may not be quite the same - you may wanna take a look :)
– Avi
Aug 22 at 20:21
• The easiest way is to only use two non-adjacent types of move, e.g. turns of the bottom right and the top left squares, leaving the bottom left and top right untouched. I may write up a solution later. Aug 22 at 20:33

The standard way to do this is to use commutators. But these do only even permutations, and swapping a pair is an odd permutations. You need to change the parity by doing a single move.

Calling A and B the upper left and lower right button, start by pressing B.

Now the problem becomes to rotate green hex -> green square -> red hex -> green hex. This is an even permutation, which is good.

This rotation of 3 pieces can be done by taking pieces in and out of the bottom right square with AA moves, alternating with B moves to navigate between positions. Take a piece out of the bottom right square, rotate the bottom right square to present the position where the piece belongs (relative to the red square) and put the piece back. Continue until all pieces are in place.

The total sequence is: B (fix the parity) AA (take out the red hex) BB AA (place the red hex back in the opposite corner, get the green hex) B AA (put the green hex back in the next position, take out the green square) B AA (put the green square to where it belongs, recover the yellow circle)

Starting with an even permutation means you will do an even number of AA moves and therefore the yellow square and green disk return to their place. If not, you would end up with another pair to swap.

• nice that was really helpful. Thank you! Didn't consider that two buttons were enough. When i tried it with adjacent buttons before, i was only able to invert the positioning of all three affected pairs at once, which confused me. Aug 22 at 21:38