Macro and basic command rules

A macro provides a shorthand method of executing a sequence of basic commands. Macros can contain other macros nested to any depth but cannot call themselves (if that happens an error will be flagged). In all cases a sequence of basic commands results when macros are fully expanded. Command sequences are not case-sensitive and any lower case letter entered by the user will be internally converted to and displayed as upper case.

For convenience define a basic command as " b" and a macro as "m".

A basic command results in a 90 degree clockwise (CW) rotation of one or more layers. Outer layer basic commands are L, F, R, B, U and D. Multiple layer commands are represented, for example, by 5U, 13F and WR where the numeric index indicates the number of layers and W represents the cube size. Single inner layer commands are represented, for example, by #5U and #13F, or 05U and 013F. A "-" sign ahead of the basic command results in a 90 degree counter-clockwise (CCW) rotation.

Brackets, except for "<" and ">" (used in macro commands), are accepted in command sequences but they do not result in any change in the cube state. For convenience define "()" as representing no change in cube state. The following equalities apply for basic commands:

bbbb = ()
b-b = ()
-bb = ()
bbb = -b

A macro can be defined by any one of 18 available alphabetical characters (the six basic command letters, and reserved characters W and M, are excluded) or numerically by a two-digit number (for cubes of size less than 17), or a four-digit number (for cubes of size greater than 16), enclosed within angle brackets or following the letter M. For further details on numerical macros, refer to Macro definition.

If macro m is defined then -m is also valid and obeys the relationship:

m-m = ()
-m m = ()

Macro -m is simply the reverse sequence for m and does not need to be defined separately to m.