Chapter 7: Twiddle

Twiddle is a tile-rearrangement puzzle, visually similar to Sixteen (see chapter 6): you are given a grid of square tiles, each containing a number, and your aim is to arrange the numbers into ascending order.

In basic Twiddle, your move is to rotate a square group of four tiles about their common centre. (Orientation is not significant in the basic puzzle, although you can select it.) On more advanced settings, you can rotate a larger square group of tiles.

I first saw this type of puzzle in the GameCube game ‘Metroid Prime 2’. In the Main Gyro Chamber in that game, there is a puzzle you solve to unlock a door, which is a special case of Twiddle. I developed this game as a generalisation of that puzzle.

7.1 Twiddle controls

To play Twiddle, click the mouse in the centre of the square group you wish to rotate. In the basic mode, you rotate a 2×2 square, which means you have to click at a corner point where four tiles meet.

In more advanced modes you might be rotating 3×3 or even more at a time; if the size of the square is odd then you simply click in the centre tile of the square you want to rotate.

Clicking with the left mouse button rotates the group anticlockwise. Clicking with the right button rotates it clockwise.

You can also move an outline square around the grid with the cursor keys; the square is the size above (2×2 by default, or larger). Pressing the return key or space bar will rotate the current square anticlockwise or clockwise respectively.

7.2 Twiddle parameters

Twiddle provides several configuration options via the ‘Custom’ option on the ‘Type’ menu:

You can configure the width and height of the puzzle grid.

You can configure the size of square block that rotates at a time.

You can ask for every square in the grid to be distinguishable (the default), or you can ask for a simplified puzzle in which there are groups of identical numbers. In the simplified puzzle your aim is just to arrange all the 1s into the first row, all the 2s into the second row, and so on.

You can configure whether the orientation of tiles matters. If you ask for an orientable puzzle, each tile will have a triangle drawn in it. All the triangles must be pointing upwards to complete the puzzle.

You can ask for a limited shuffling operation to be performed on the grid. By default, Twiddle will shuffle the grid so much that any arrangement is about as probable as any other. You can override this by requesting a precise number of shuffling moves to be performed. Typically your aim is then to determine the precise set of shuffling moves and invert them exactly, so that you answer (say) a four-move shuffle with a four-move solution. Note that the more moves you ask for, the more likely it is that solutions shorter than the target length will turn out to be possible.