# ¿PHP 2x2 random state scrambler?



## Mr.Toad (Mar 21, 2011)

Hi, I'm currently developing something in PHP and I need to generate scrambles. I've translated the _megascramble_ function from qqTimer into PHP. Then I've started with the suboptimal random state function (_get2x2optscramble_), and I've already have a headache , because it's big and obfuscated.

Is there any 2x2 random state scrambler out there? If I desist and I finally use the _megascramble_ funtion to generate 3-gen 2x2 scrambles, how many moves should they have?


----------



## qqwref (Mar 21, 2011)

The code to optimally solve a 2x2 was taken from here: http://www.jaapsch.net/puzzles/javascript/cube2j.htm

There's a lot of code and I don't really understand the details of how it works, which is why I obfuscated it for qqtimer. Good luck translating it all...


----------



## Mr.Toad (Mar 21, 2011)

Thanks, qqwref. I think I shouldn't do this right now if I want to advance, for now I'll go with non-optimal scrambles. Again, how many moves should they have?


----------



## qqwref (Mar 21, 2011)

qqTimer uses 25 moves, but that might be overkill. Maybe 15?


----------



## Walter Souza (Mar 21, 2011)

Prisma has a 2x2x2 scrambler: https://bitbucket.org/walter/puzzle-timer/src/b04aad76f602/src/com/puzzletimer/solvers/RubiksPocketCubeSolver.java.

The solver is pretty straightforward: move tables, prunes tables, IDA*. You can define the generating set and minimum scramble length. It's java, though.


----------



## Kenneth (Mar 22, 2011)

Mr.Toad said:


> Thanks, qqwref. I think I shouldn't do this right now if I want to advance, for now I'll go with non-optimal scrambles. Again, how many moves should they have?


 
Gustav Fredell did a mass search using A-cube on random move 2x2x2 scrambles. He found that 16 is enough to reach almost random distribution, in most cases 15 also works. (I don't remember the figures but it was like 99.xx% for 16 and 98.xx% accurancy for 15 moves)


----------



## Mr.Toad (Mar 22, 2011)

Thanks, Kenneth, I'll use 16 moves.


----------



## Kenneth (Mar 23, 2011)

I was looking for Gustavs post at SveKub, and found it, but he presented the results in a image, that seems to be lost (we had a couple of pirates that overtook the site some years ago, we reinstalled a new version of the software to protect the site, the old posts are still there but the images are gone or the URL's are wrong at least, I will see if I can get Gunnar to look for it when I get to him). http://www.svekub.se/forum.html?func=view&id=8580&catid=11#8580 (the server is feeling bad atm, hopefully it will get better soon).

During my search for the tread I stumled into an other thread about 2x2x2, about a link to a site: http://www.typeotech.net/index.php?page=cube2x2

It is in quarter moves, (14 maximum)


----------



## irontwig (Mar 23, 2011)

Has anybody done a similar test on the 3x3? I have a hunch that 25 moves is slightly easier than random state.


----------



## Mr.Toad (Mar 23, 2011)

Thanks a lot, very interesting link!


----------



## Mr.Toad (Apr 5, 2011)

Hi again. Now what I need to know is how many random moves are needed to scramble Pyraminx property. Any ideas? Thanks a lot.


----------



## Kenneth (Apr 5, 2011)

As always when it comes to numbers like that, look at Jaap's pages.

http://www.jaapsch.net/puzzles/pyraminx.htm


----------



## Mr.Toad (Apr 5, 2011)

Thanks, Kenneth. It seems like there's a lot of interesting stuff in that site!


----------



## qwr (Apr 29, 2021)

Kenneth said:


> Gustav Fredell did a mass search using A-cube on random move 2x2x2 scrambles. He found that 16 is enough to reach almost random distribution, in most cases 15 also works. (I don't remember the figures but it was like 99.xx% for 16 and 98.xx% accurancy for 15 moves)



Does anyone have the exact numbers for this?


----------

