# What are the official rules for generating Rubik's Cube scrambles?

I am writing a program that will keep track of the data I generate from speed-solving Rubik's cubes, and the first component is to generate a scramble. As is stands, my program currently creates a 30-move long sequence that uniformly chooses sides and directions to turn (in a manner that does not include repeat/dummy moves like R' R2 or U2 D' U).

According to the World Cubing Association Regulations page (specifically rule 4b3), the cube must be in a random state that is 2 moves or more away from the solved state. I am relying on the sheer unlikelihood of a 30-move scramble producing any states that are 1 move away from being solved. However, no other rules are given, nor are any details about the "official WCA scrambling program" that I am trying to replicate.

Is there a site that I have not found that describes if there are any more rules in scrambling a cube? I suspect that I am missing at least some rules, as many scrambles that I get from qqTimer scramble colors on a set of two opposite faces and a set containing the other four faces without overlap (for example, two faces contain ONLY white/yellow pieces, and the other four contain ONLY red/blue/green/orange pieces).

• – greenturtle3141 Sep 15 '16 at 3:52
• @greenturtle3141 The only useful information from that question is (tnoodle)[github.com/cubing/tnoodle], on which I cannot find the information I seek on this question (though I may not be looking at the right place; there are so many files on that git). – Arcturus Sep 15 '16 at 4:00
• @eridan To make it easier for others wishing to visit your link. It should be [description](link) ie. tnoodle – dcfyj Sep 15 '16 at 12:49
• @dcfyj I know, I just put the brackets in the wrong order. I wish I could edit the comment now. – Arcturus Sep 15 '16 at 14:15

This is what they use: https://www.worldcubeassociation.org/regulations/scrambles/

An alternative program would be Herbert Kociemba's Cube Explorer the version I have (5.01s) has a generate WCA scramble function.

To make a random scramble in your own software you can, rather than relying on turns, randomly choose which place and orientation each of the cubies go up to the last corner and edge and then check which way they may go subject to parity. See: https://math.stackexchange.com/questions/127577/how-to-tell-if-a-rubiks-cube-is-solvable/127627#127627

• Thank you for showing me the download link for tnoodle. Unfortunately, I do not see how your suggestion in the second paragraph can help me. The goal I have is to generate a scramble SEQUENCE, not an array of what pieces are being put where. – Arcturus Sep 15 '16 at 4:12
• Ah well, yes you'd have to write a solver too in that case; then the scramble is the reverse. Maybe too much work? – Jonathan Allan Sep 15 '16 at 4:14
• How about cube explorer? ...let me find a link. – Jonathan Allan Sep 15 '16 at 4:17
• Added a link to Cube Explorer. It has an API too, but I'm not sure where the details are (help file not working) – Jonathan Allan Sep 15 '16 at 4:25