Explaining the magic-code of a configuration

The magic-code of a configuration is a sequence of characters (like RRmRRmRUmDUm) with eight capital letters taken from the set RLUD (right, left, up, down) optionally followed by the lower letter m (mountain fold) or v (valley fold).

They encode the relative adjacency information of each of the eight tiles with the following one. The first tile (say T0) is oriented by drawing an arrow on one of its faces (front) parallel to a side. The selected orientation for T0 must be such that the nylon strings cross the front face in the direction south-west to north-east (slash direction)

The first capital letter indicate which one of the four sides of T0 is connected to T1 (the subsequent tile), the presence of the lowercase m or v indicate that T0 and T1 form a 90 degrees angle either with a mountain fold (letter m) or with a valley fold with respect to the front face of T0. Otherwise T1 is coplanar with T0.

The orientation of T1 is inherited by the selected orientation of T0 in such a way that the drawn arrow on T1 (in case of coplanarity) is exactly the mirror image of the arrow on T0 with respect to the hinging site (the side of T0 adjacent to T1) as shown in the image where up-arrows should be substituted to the numbers 3 and 4. As a simple example the starting 2x4 configuration of the puzzle can be encoded as RRRURRRU where it should be noted that the four tiles in the top row have downward arrows.

Since we are interested to configurations of the undecorated puzzle (black tiles with the indication of the direction of the nylon strings), many distinct magic codes describe the same configuration based on which tile we select as T0, how we orient it (such that T0 becomes a slash tile) and in which direction we traverse the circular chain of eight tiles. The corresponding magic codes are all considered equivalent. A canonical magic code is then selected by taking all the disting magic codes and selecting the first one with respect to a suitable lexicographic ordering.

The mirror image of a constructible configuration can also be constructed by using the mirror images of the sequence of construction moves starting from the original 2x4 configuration, so that we also include all the magic codes of the mirror images in the same equivalence class.

For definiteness, in the real puzzle we select as T0 the lower-left tile of the original 2x4 configuration. Then T1 through T7 are numbered in counter-clockwise order. The italian page rubiksmagic code interface can be used to display a "magic photo" of the puzzle for any given configuration. That page also include instructions of how to construct the magic code from a configuration of the real puzzle.

Examples