# Online Official-Style Square-1 Scrambler with Images



## Lucas Garron (Nov 27, 2009)

This is based on Eidolon's imagesq.

Apparently no one has quite done this, so I went ahead.
http://cube.garron.us/WCA/proposals/scramble/scramble_square1_img.htm

Most important: Unless you have Eido's script on a local host, you will have to be on the internet to load scramble images.
The image is off by (0,1) because of Eido's specs, and does not contain the E-slice.


----------



## Forte (Nov 27, 2009)

Cool! It's always good to know when you've scrambled right 

The colour scheme change is not working though.


----------



## Lucas Garron (Nov 27, 2009)

Forte said:


> Cool! It's always good to know when you've scrambled right
> 
> The colour scheme change is not working though.


It was, although the colorscheme field would reset on reload (you had to input the colors again every time you wanted them). Fixed now.


----------



## idpapro (Nov 27, 2009)

it would be great if this was integrated into the qqtimer!!


----------



## qqwref (Nov 27, 2009)

idpapro said:


> it would be great if this was integrated into the qqtimer!!



qqtimer does not and never will do images. The ratio of extra work/code to extra usefulness is far too large.


----------



## idpapro (Nov 27, 2009)

qqwref said:


> idpapro said:
> 
> 
> > it would be great if this was integrated into the qqtimer!!
> ...



ok, i understand, thanks for the consideration though!


----------



## hr.mohr (Nov 27, 2009)

Very nice Lucas!


----------



## StachuK1992 (Nov 27, 2009)

The thing is, with sq-1, one usually knows if they did it right or not, since a lot of turns aren't possible if you mess up previously.

Nonetheless, great job!


----------



## Muesli (Nov 27, 2009)

Can't you incude '/'s in the scrambles? It can be confusing when to slice the cube.


----------



## StachuK1992 (Nov 27, 2009)

Musli4brekkies said:


> Can't you incude '/'s in the scrambles? It can be confusing when to slice the cube.


Slice after every (x,x) except the last. That's what the pictures seem to show.


----------



## trying-to-speedcube... (Nov 27, 2009)

But Ron always tells us: ") means )/". So slice after each (x,x).

Anyway, it's always nice to be 100% certain you did the scramble correctly


----------



## Muesli (Nov 27, 2009)

trying-to-speedcube... said:


> But Ron always tells us: ") means )/". So slice after each (x,x).
> 
> Anyway, it's always nice to be 100% certain you did the scramble correctly


I get it.


----------



## Lucas Garron (Nov 27, 2009)

trying-to-speedcube... said:


> But Ron always tells us: ") means )/". So slice after each (x,x).


Then apparently the scrambler is wrong, highlighting yet another issue.
I think it does 40 random actions (AUF, ADF, or /), and it's impossible to tell (easily) from the notation if there was a last twist or not.
Rather, the official notation requires a last twist, and the scrambler internally might not.

(I take each final Square-1 state straight out of Jaap's code.)


----------



## jfly (Nov 27, 2009)

Excellent job Lucas! There's no reason this shouldn't be the new wca scrambler.

And yes, the ambiguities added with removing the "/" from the notation are very annoying. Although I remember porting Jaap's code to java for cct, and I don't recall any such problem with missing trailing slashes. I trust you to be making correct use of Jaap's code, however.


----------



## Lucas Garron (Nov 27, 2009)

j-fly said:


> Excellent job Lucas! There's no reason this shouldn't be the new wca scrambler.
> 
> And yes, the ambiguities added with removing the "/" from the notation are very annoying. Although I remember porting Jaap's code to java for cct, and I don't recall any such problem with missing trailing slashes. I trust you to be making correct use of Jaap's code, however.


There's one reason: All WCA scramblers should run offline, preferably with no big requirements (e.g. a PHP installation is probably too much).
This is an unofficial restriction by Ron himself.

Also, don't trust me. I totally just took the end of the first appropriate loop I saw. 

Can you use the CCT code to (easily) generate Square-1 images from a slimmer jar?


----------



## blade740 (Nov 27, 2009)

Even offline, this scrambler is the same as the official one.


----------



## Lucas Garron (Nov 29, 2009)

Alright, thanks to some more work by Eido to make port the PHP script to a JS library by a Walter Zorn:

Javascscript-Only Official-Style Square-1 Scrambler with Images

Also available as a single file or a zip with all 3 files.

Problem is, it doesn't seem to work in IE, and I don't know a simple way to fix that.


----------



## blade740 (Nov 29, 2009)

Lucas Garron said:


> Alright, thanks to some more work by Eido to make port the PHP script to a JS library by a Walter Zorn:



And thanks to qq for cleaning up my code and fixing a few things (including adding back the final (0,0) indicating another / at the end). Teamwork ftw

http://mzrg.com/miniSites/scramblers/sq1_wca.html



> Problem is, it doesn't seem to work in IE, and I don't know a simple way to fix that


Deleting IE would be a start.

Edit:
The library I used says it works on IE 4, 5, and 6, Firefox, Chrome, Opera, and Safari (among others)


----------



## Lucas Garron (Nov 29, 2009)

blade740 said:


> Lucas Garron said:
> 
> 
> > Alright, thanks to some more work by Eido to make port the PHP script to a JS library by a Walter Zorn:
> ...


Quite nice, qq.

I think

```
var stickers = (b.concat(c)).replace(/0/g,colorString[0]).replace(/1/g,colorString[1]).replace(/2/g,colorString[2]).replace(/3/g,colorString[3]).replace(/4/g,colorString[4]).replace(/5/g,colorString[5]);
		document.writeln("<tr><td><font face='Arial' size=3><b>&nbsp;&nbsp;"+scramblestring(i)+"<\/b><\/font><\/td><td>"+"<div style=\"position:relative;height:100px;width:200px;\" id=\"scramble"+i+"\">");
		drawSq(stickers,a,"scramble"+i);
		document.writeln("<\/div><\/td><\/tr>");
```
is a cleaner way to do the drawing, though.

Also, I probably should have used more descriptive variable names. 

Eido: IE in VirtualBox draws all the pieces red for me. It's not like I care, but Ron might.


----------



## blade740 (Nov 29, 2009)

Red is a color I was using to debug (it's the color set in the beginning, I forgot to take out that line) I'll try to see what's going on there tomorrow.


----------



## qqwref (Nov 29, 2009)

It's all black on IE for me, not that I care since I don't use that browser.


----------



## Johannes91 (Nov 29, 2009)

What's the point in using document.writeln? It makes the whole page reload when generating scrambles and I can't see any reason to do that.


----------



## qqwref (Nov 29, 2009)

That's a holdover from Jaap's code. If you're going to complain about that, why not complain about all the other stupid **** Jaap's code does? Ick. I think most of the time people just don't care enough to fix it up.


----------



## Johannes91 (Nov 30, 2009)

qqwref said:


> That's a holdover from Jaap's code.


I know. But his scramblers have been modified many times by many people and it seems that every time that "feature" is kept in. It should be really easy to change so I thought maybe there's a reason.



qqwref said:


> If you're going to complain about that, why not complain about all the other stupid **** Jaap's code does? Ick.


Because most of them are just implementation details that don't matter to users. But it's not a big deal, I hardly ever use WCA scramblers anyway.


----------



## JBCM627 (Nov 30, 2009)

qqwref said:


> It's all black on IE for me, not that I care since I don't use that browser.





Lucas Garron said:


> Eido: IE in VirtualBox draws all the pieces red for me. It's not like I care, but Ron might.


Looks fine in IE8 on XP.
This is running atm, but should be done sooner or later: http://browsershots.org/http://mzrg.com/miniSites/scramblers/sq1_wca.html


----------



## Chaos2011 (Nov 30, 2009)

The CCTimer does this, and color schemes


----------



## Lucas Garron (Nov 30, 2009)

Chaos2011 said:


> The CCTimer does this, and color schemes


1) I've never heard it called "CCTimer".
2) Yes, I know.
3) Yes, I know.
4) That's not the point.
(5) Actually, CCT doesn't do this. CCT doesn't generate 5 scrambles on a single, printable page.)


----------



## qqwref (Nov 30, 2009)

Johannes91 said:


> qqwref said:
> 
> 
> > That's a holdover from Jaap's code.
> ...


It should. I've fixed a lot of his sillinesses in my own versions of his scramblers, but nobody looks at those (or at least the code for those). As long as the official scrambler has Jaap's code, people will have to modify Jaap's code every time they want to make a modified scrambler. Nobody starts working from an unofficial version.


----------



## jfly (Nov 30, 2009)

Lucas Garron said:


> (5) Actually, CCT doesn't do this. CCT doesn't generate 5 scrambles on a single, printable page.)



Don't be so sure. Have you ever tried the "Export to HTML" option?


----------

