# Can someone help me make a custom scrambler?



## Shiv3r (Jan 19, 2017)

The first and most important scrambler I need is this: 
A 4x4 scrambler that only scrambles <l,r,U>(pretty much the equivalent of F2B+CMLL solved on 4x4). 
The reasons are because 1) I have to drill the Lewis Method's step 5 a lot, and 2) I want to make some step 5 example solves and I want to post the scrambles in the description so people can follow along. (step 5)
If you want more of a challenge, an X-cube scrambler would be nice. I got one from a non-cuber friend a few days ago, and I have a hard time actually scambling is well.

Thanks fellow coders!
EDIT: Im sorry, this is the first time I have posted in the software thread. If there is another thread this should go in, please tell me. thanks!


----------



## YTCuber (Jan 19, 2017)

Paste the following into your browsers console and you will get a 4x4 lrU scramble.

```
function rndEl(b){return b[~~(Math.random()*b.length)]}function rn(b){return~~(Math.random()*b)}function scramble(b,e,h,f){var c,d,g=[],a=[];f||(f={});if(!(2>b.length||1>e.length)){for(c=0;c<b.length;++c)for(d=0;d<e.length;++d)g.push(""+b[c]+e[d]);for(;a.length<h;)a.push(rndEl(g)),1<a.length&&f[a[a.length-1][0]]==a[a.length-2][0]&&a.pop(),2<a.length&&a[a.length-1][0]==a[a.length-2][0]&&a.pop();return a.join(" ")}}alert(scramble(["l","r","U"],["","'","2"],40,{l:"r",r:"l"}));
```

For X-Cube:

```
function rndEl(b){return b[~~(Math.random()*b.length)]}function rn(b){return~~(Math.random()*b)}function scramble(b,e,h,f){var c,d,g=[],a=[];f||(f={});if(!(2>b.length||1>e.length)){for(c=0;c<b.length;++c)for(d=0;d<e.length;++d)g.push(""+b[c]+e[d]);for(;a.length<h;)a.push(rndEl(g)),1<a.length&&f[a[a.length-1][0]]==a[a.length-2][0]&&a.pop(),2<a.length&&a[a.length-1][0]==a[a.length-2][0]&&a.pop();return a.join(" ")}}alert(scramble("UDRLFBufbl".split(""),["","'","2"],60,{R:"L",L:"R",F:"B",B:"F",D:"U",U:"D",u:"d",d:"u",f:"b",b:"f"}));
```
A small letter represents the outer layer, a big one inner+outer layer. The program does 60 moves, but you can change that by replacing the 60 with any number >3.


----------



## Shiv3r (Jan 19, 2017)

YTCuber said:


> Paste the following into your browsers console and you will get a 4x4 lrU scramble.
> 
> ```
> function rndEl(b){return b[~~(Math.random()*b.length)]}function rn(b){return~~(Math.random()*b)}function scramble(b,e,h,f){var c,d,g=[],a=[];f||(f={});if(!(2>b.length||1>e.length)){for(c=0;c<b.length;++c)for(d=0;d<e.length;++d)g.push(""+b[c]+e[d]);for(;a.length<h;)a.push(rndEl(g)),1<a.length&&f[a[a.length-1][0]]==a[a.length-2][0]&&a.pop(),2<a.length&&a[a.length-1][0]==a[a.length-2][0]&&a.pop();return a.join(" ")}}alert(scramble(["l","r","U"],["","'","2"],40,{l:"r",r:"l"}));
> ...


I have a chromebook, will this still work? thanks btw. 
EDIT: I don't think I understand what you mean by "Browser's console", can you please elaborate? I am inexperienced with actual applications in coding but I know how to code pretty well.


----------



## YTCuber (Jan 19, 2017)

As long as you have a browser installed yes. For chrome: press Ctrl+Shift+J


----------



## Shiv3r (Jan 19, 2017)

YTCuber said:


> As long as you have a browser installed yes. For chrome: press Ctrl+Shift+J


Oh you mean ctrl+alt+T? ctrl+Shift+J doesnt work...
EDIT: found out why. the school disabled it for some stupid reason. When I get to an actual computer Ill gen like 15 or so scrambles and use those.


----------



## YTCuber (Jan 19, 2017)

No, I mean what I said. https://developers.google.com/web/tools/chrome-devtools/console/
You can also access it here:
https://ytcuber.github.io/test/l.html


----------



## Shiv3r (Jan 19, 2017)

thank you so much! you really helped!


----------



## YTCuber (Jan 19, 2017)

No problem!


----------



## Shiv3r (Jan 20, 2017)

Hey, taken from the thread I was just on: 


Teoidus said:


> Can you please tell TYCuber to use .innerHTML = s on a div element instead of alert(s)?


----------



## YTCuber (Jan 21, 2017)

Can you please tell @Teoidus to spell my username correct?
The site now prints the scramble under the buttons instead of alerting it.


----------



## Shiv3r (Jan 21, 2017)

thx!


----------



## Shiv3r (Jan 24, 2017)

Xcuse me, gonna talk again. 
One thing you missed about the X-cube is that if an extended face is not complete(meaning not shapeshitfed and having like "holes") it _Cannot_ turn. So therefore, it is probably a better idea to at the beginning just twist all the 4 extended faces a random direction and then do a 3x3 scramble, which I probably will do from now on.


----------



## YTCuber (Jan 24, 2017)

I don't own a XCube, so I couldn't check whether my scramble program is working correctly.
The problem with your scrambling method is, that if you solve the inner 3x3, you always have a skip of the extended faces.
Is it correct, that I can apply moves from <R2,L2,B2,F2,D,U,l,b,r,f> to the solved state and don't get blocked moves? If so, these moves followed by a 3x3x3 Scramble would be the full scramble.


----------

