# Optimal 2x2 Scrambles for CCT (for versions <=0.9.4)

#### masterofthebass

Thanks to Tim Sun (who basically translated Jaap's code), I was able to put together a cct scramble plugin for random state, optimal 2x2. Just put the .class file in the scramble plugins folder of your CCT directory.

#### Attachments

• 2.5 KB Views: 111

#### Anthony

##### Professional Speedcuber
Thanks, I've been hoping someone would do this for a while now.

#### puzzlemaster

##### Member
hm...how many moves should it be?

#### masterofthebass

hmm... Apparently version 0.9.5 already has this, but this plugin will work for earlier versions of CCT (I'm running 0.9.4).

#### JustinJ

Doesn't CCT 0.9.5 already have optimal 2x2 scrambles? This is good if you're using an older version though, I guess.

Edit: ninja'd

#### luisgepeto

##### Member
Where can I get CCT 0.9.5? Because my CCT is 0.9.3 and that file doesn't seems to work...
EDIT: Found it, nevermind

Last edited:

#### Swordsman Kirby

##### Member
hmm... Apparently version 0.9.5 already has this, but this plugin will work for earlier versions of CCT (I'm running 0.9.4).
Wasted my time, fool!

##### Member
who basically translated Jaap's code)
Does anyone have a link to this code? I can't seem to find it.

#### Shortey

Where can I get CCT 0.9.5? Because my CCT is 0.9.3 and that file doesn't seems to work...
EDIT: Found it, nevermind
On Lucas' website of course.

EDIT: 200th post. =)

#### masterofthebass

hmm... Apparently version 0.9.5 already has this, but this plugin will work for earlier versions of CCT (I'm running 0.9.4).
Wasted my time, fool!
I really didn't want it for cct. I already told you that.

who basically translated Jaap's code)
Does anyone have a link to this code? I can't seem to find it.
check the source of the official scrambler.

##### Member
who basically translated Jaap's code)
Does anyone have a link to this code? I can't seem to find it.
check the source of the official scrambler.
This scrambler? It doesn't seem to use optimal 2x2 scrambles, unless I am missing something.

##### Member
Ah, didn't look there. Thanks!

#### Cride5

http://www.worldcubeassociation.org/regulations/scrambles/scramble_cube_222.html

that's the scrambler you get when you look in the regulations.
Correct me if I'm wrong but technically that isn't a random-state scrambler.

The function which does the scramble is as follows:
Code:
function mix(){
initbrd();
for(var i=0;i<500;i++){
var f=Math.floor(Math.random()*3+3) + 16*Math.floor(Math.random()*3);
domove(f);
}
}
...which basically applies 500 random moves to the cube. I know this because I made use of Jaap's solver for the 2x2 scrambler in cTimer, but I had to write supporting code to generate random cube states (code here). Of course, the statistical difference between a 500-move scramble and a random-state scramble will be negligible on a 2x2, but using 500 random moves just seems like an inefficient hack.

Last edited:

#### Swordsman Kirby

##### Member
Correct me if I'm wrong but technically that isn't a random-state scrambler.

The function which does the scramble is as follows:
Code:
function mix(){
initbrd();
for(var i=0;i<500;i++){
var f=Math.floor(Math.random()*3+3) + 16*Math.floor(Math.random()*3);
domove(f);
}
}
...which basically applies 500 random moves to the cube. I know this because I made use of Jaap's solver for the 2x2 scrambler in cTimer, but I had to write supporting code to generate random cube states (code here). Of course, the statistical difference between a 500-move scramble and a random-state scramble will be negligible on a 2x2, but using 500 random moves just seems like an inefficient hack.
It just means that the programmer doesn't really understand what random-state refers to. It's also very very easy to generate a random position; I don't understand why you guys are using such convoluted methods. >_>

Last edited:

#### Cride5

It just means that the programmer doesn't really understand what random-state refers to. It's also very very easy to generate a random position; I don't understand why you guys are using such convoluted methods. >_>
Hmm, is my randomCube() function a bit bloated?? I couldn't think of a more direct algorithm than that :confused:

#### Swordsman Kirby

##### Member
It just means that the programmer doesn't really understand what random-state refers to. It's also very very easy to generate a random position; I don't understand why you guys are using such convoluted methods. >_>
Hmm, is my randomCube() function a bit bloated?? I couldn't think of a more direct algorithm than that :confused:
Given that Jaap's solver just uses two numbers for the position, you should just be randomly generating those two numbers. I don't know what Dan did to modify the code for CCT, but this is how I generated a random position in the original scrambler:

int p = (int)(Math.random()*5040), o = (int)(Math.random()*729);

Last edited: