dbax0999
Veteran
Haha I made a scrambler in TI-basic last year so we could get scrambles on our calculators.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
How is that relevant?What if you aren't color neutral? Wouldn't it matter then?
How is that relevant?
If 10 peoples' cubes are scrambled with the same algorithm, and any state can be reached in 25 moves, then everyone's puzzle should be well-scrambled just as if they were scrambled with a random first face. No?
Haha I made a scrambler in TI-basic last year so we could get scrambles on our calculators.
:ClrHome
:Clrdraw
:AxesOff
:FnOff
:"URFDLBw '2→Str0
:0→C
:0→E
:0→F
:For(A,1,60,6
:For(B,1,97,14
:D→E
:C→D
:F→G
:randInt(7,8→F
:While C=D
:randInt(1,6→C
:While C=E and C-3=D or C+3=D
:randInt(1,6→C
:End
:If C=D and F≠G and C≠E
:10→C
:End
:If C=10
:D→C
:Text(A,B,sub(Str0,C,1)+sub(Str0,F,1)+sub(Str0,randInt(8,10),1
:End
:End
function r(x){return Math.floor(Math.random()*x)}function s(){var d=b=j=c=a=4;for(;j<29;j++){while(a==c&&d&b){a=r(3);b=r(2)+1}if(a!=c)d=0;c=a;d+=b;document.write("RLFBUD".charAt(a*2+b-1)+" 2'".charAt(r(3))+" ")}}
120 chars.
Code:map{while(($m=int rand 6)==$b||($c+$b==5&&$c==$m)){}print qw(U R F B L D)[$m].qw( ' 2)[int rand 3]." ";$c=$b;$b=$m}1..25
But yeah, like Lucas said, I'm sure there's a bunch of people who could destroy this, since mine is pretty basic.
Edit: 115
Code:map{$m=int rand 6while$c+$b==5&&$c==$m||$m==$b;print qw(U R F B L D)[$m].qw( ' 2)[int rand 3]." ";$c=$b;$b=$m}1..25
>_>
Stefan. I'm sure you made a short one earlier, but i forgot where ... Enlighten us pls!!
Per
Stefan. I'm sure you made a short one earlier, but i forgot where ... Enlighten us pls!!
Per
Down to 212 characters thanks to Devin:
Code:function r(x){return Math.floor(Math.random()*x)}function s(){var d=b=j=c=a=4;for(;j<29;j++){while(a==c&&d&b){a=r(3);b=r(2)+1}if(a!=c)d=0;c=a;d+=b;document.write("RLFBUD".charAt(a*2+b-1)+" 2'".charAt(r(3))+" ")}}
function r(n){if(n)return Math.floor(Math.random()*n);for(d=b=j=c=a=4;j++<29;){for(;a==c&&d&b;b=r(2)+1,a=r(3));d=a!=c?b:d+b;c=a;document.write(" RLFBUD"[a*2+b]+" 2'"[r(3)]+" ")}}
:ClrHome
:"URFBLD '2→Str0
:6→S
:0→F
:For(A,1,5,1
:For(B,1,14,3
:P→L
:F→P
:randInt(1,S→F
:randInt(7,9→T
:While F=P
:randInt(1,S→F
:End
:If L=T
:6→T
:If F+P=7
:Then
:5→S
:Else
:6→S
:End
:Output(A,B,sub(Str0,F,1)+sub(Str0,T,1
:End
:End
:ClrHome
:"URFBLD '2→Str0
:6→S
:0→F
:For(A,1,5,1
:For(B,1,14,3
:P→L
:F→P
:randInt(1,S→F
:While F=P
:randInt(1,S→F
:End
:If L=T
:6→T
:If F+P=7
:Then
:5→S
:Else
:6→S
:End
:Output(A,B,sub(Str0,F,1)+sub(Str0,randInt(7,9),1
:End
:End
Some improvements ...
179 characters.
Code:function r(n){if(n)return Math.floor(Math.random()*n);for(d=b=j=c=a=4;j++<29;){for(;a==c&&d&b;b=r(2)+1,a=r(3));d=a!=c?b:d+b;c=a;document.write(" RLFBUD"[a*2+b]+" 2'"[r(3)]+" ")}}
just call r() with no args.
function r(n){if(n)return Math.floor(Math.random()*n);for(d=b=j=c=a=4;j<29;)b=r(2)+1,a=r(3),a==c&&d&b||(d=a!=c?b:d+b,c=a,j++,document.write(" RLFBUD"[a*2+b]+" 2'"[r(3)]+" "))}
there are some long names in javascript that can't be avoided such as:
function(){} return Math.floor() Math.random() document.write()
and they account for 64 characters.