# Programmers wanted for 2x2x2, 4x4x4 and 5x5x5 cubes



## bcube (Aug 29, 2015)

Hi,

recently there was a thread regarding replacement of old Java applets of Rubik´s cube 3x3x3 by JavaScript alternative.

I was very pleased by all the participants/volunteers and as a result, several JavaScript simulators have been made or are still in development (for more details see the link above).

Now, I am wondering if anyone is willing to make also 2x2x2, 4x4x4 and 5x5x5 simulators soon, which could be easily put into a web-site, similarly to 3x3x3 simulator? It doesn´t have to be completely new programing task because there already are Werner´s Java applets of those puzzles as well as Lucas´ not-easy-to-implement JavaScript simulators of those puzzles. Extension of Josef´s Java applets is another option because there is a way how to import his Java applet into JavaScript (for more information see the link above).


----------



## Calode (Aug 29, 2015)

https://github.com/cubing/jsss
https://www.npmjs.com/package/scrambo

nuff' said?


----------



## molarmanful (Aug 29, 2015)

Calode said:


> https://github.com/cubing/jsss
> https://www.npmjs.com/package/scrambo
> 
> nuff' said?


Those ain't simulators.

My gCube can be 'modded' into a 2x2. Will add that as another functionality. 4x4 and 5x5 will be another story...


----------



## Calode (Aug 29, 2015)

Oh, I apologize. The whole time I was reading that, I was reading scrambles. 

Sent from my SM-G900V using Tapatalk


----------



## bcube (Jan 22, 2016)

Wow, people have made wonderful things recently.

Not only Conrad presented his visualisation tool, see also what beautiful simulator Michael made.

Moreover, I am aware of more excellent programmers who are working on JS simulators 

Thank you all for awesome job and keep it up


----------



## unsolved (Feb 14, 2016)

I finished my 5x5x5 solver over the weekend. It can't get beyond depth 17 without a struggle though. I'm working on a stage solver for it now.



Spoiler


----------



## bcube (Feb 15, 2016)

unsolved, even though I believe it is a big achievement for you, I would like to point out what Christopher recently wrote to you (appareantly the moderators deleted it beacuse I cannot find it anymore anywhere): this has nothing to do with the topic (unless I am missing something), thus I suggest you to start new thread about it. If it is okay with you, could the moderators delete the last two posts, please?


----------



## unsolved (Feb 15, 2016)

bcube said:


> this has nothing to do with the topic



Nothing to do with the topic?



bcube said:


> Now, I am wondering if anyone is willing to make also 2x2x2, 4x4x4 and 5x5x5 simulators soon



I've not only written a "simulator," I built a solver. How is that *NOT *related to this topic? I'm already done what is being asked for.


----------



## bcube (Feb 15, 2016)

"Nothing to do with the topic?"

Yes. Granted, I should have used unambiguous terminology to avoid confusion. Nevertheless, I think that from the original post it is clear that the topic of this thread is about web-based software (https://www.speedsolving.com/wiki/index.php/List_of_web-based_software), animation JS applets/simulators to be specific. Another common term for those is a (puzzle/cube) visualizer or visualization tool.

What you offer us is, if I am not mistaken, a PC software (https://www.speedsolving.com/wiki/index.php/List_of_PC_software), a 5x5x5 solver to be specific.

"I'm already done what is being asked for."

After clearing up this possibly confusing terminology, hopefully you can see your solver is not helpfull in this thread by any means (yet).

P.S. are you really? "... and 5x5x5 simulators soon, which could be easily put into a web-site..." ;-)


----------



## qqwref (Feb 16, 2016)

unsolved said:


> Nothing to do with the topic?
> 
> I've not only written a "simulator," I built a solver. How is that *NOT *related to this topic? I'm already done what is being asked for.


I think what is being asked for in this topic is a web application, which displays a 3D cube which can be rotated and moved around with the mouse, and can understand and display various algorithms in standard cube notation. As I understand your program, it does not run natively on the web, has a flat 2D display only with no animations, and only allows the user to type in a sequence of moves.

So, if that situation hasn't changed, your program does not solve the problems bcube is trying to solve (namely having a graphical app that people can put in tutorials or use to display and create algorithms) and thus is not relevant here.


----------



## unsolved (Feb 17, 2016)

bcube said:


> "Nothing to do with the topic?"
> 
> Yes. Granted, I should have used unambiguous terminology to avoid confusion. Nevertheless, I think that from the original post it is clear that the topic of this thread is about web-based software (https://www.speedsolving.com/wiki/index.php/List_of_web-based_software), animation JS applets/simulators to be specific. Another common term for those is a (puzzle/cube) visualizer or visualization tool.
> 
> ...



I uploaded the 2D version to my server after doing a straightforward conversion to .NET but since it's not 3D I'm guessing it is still not what is wanted. It also seems to run about 15% slower. I think this is due to the additional overhead (bloatware) in Microsoft's libraries. Also it adds some spaces in between the second row of cubes if you log in from a Vista or Windows XP machine. I'm not sure why and I'd rather not debug it.

In any event, providing the IP address of the server is probably asking for trouble, so I'll bow out and let you continue on your quest.


----------



## mikebolt (Feb 24, 2016)

Hi bcube. I have been working on a JavaScript 3D puzzle simulator project called "ThreeTwist". I was inspired by Molarmanful's gCube project, and like gCube this one is based on the code from the Google Rubik's Cube doodle, which was MIT licensed.

Here's the repository: https://github.com/mikebolt/ThreeTwist. The first big modification I attempted was to support NxNxN cubes. The display code works properly, but it cannot twist and the mouse interaction code needs to be fixed too. You can see my failed attempt here: 

I know exactly what's wrong, I just haven't had time to fix it. But in December I started working on a little webpage that tries to help you memorize an algorithm: https://mikebolt.github.io/ThreeTwist/examples/MemorizationGame.html

It uses an algorithm parser written using parsimmon.js. It supports algorithm group notation like (F R U)' and (R U R' U')3, but it doesn't support whole cube twists or fat slice twists. I actually got fat slice twists working on my local build because I'm trying to memorize a bunch of OLL algorithms, many of which involve fat twists. I'll commit it soon.

I haven't really advertised this project yet because it's not really presentable yet. I just checked out the other thread, and it looks like if I get this working it will be the first JavaScript/HTML5 NxNxN cube simulator. I have bigger plans for this project too, but I'm not sure when I'll have the time to work on it.


----------



## bcube (Feb 24, 2016)

Hello mikebolt,



mikebolt said:


> The display code works properly



Could you please make a html page where the simulator (for instance 2x2x2 - 5x5x5) can be seen for people who haven´t found it on github? Something similar to what Molarmanful made with Michael Feather's AnimCube JS (3x3x3) would be perfect. 



mikebolt said:


> it looks like if I get this working it will be the first JavaScript/HTML5 NxNxN cube simulator



Well, it really depends on what exactly do you mean by a cube simulator here (I mean, the features/parameters of a cube simulator matter for the end user, and they are not always the same). For example, see Lucas´ twisty JS (12x12x12 is usually sufficient enough - but it allows you to enter even higher order cube).


----------



## mikebolt (Mar 20, 2016)

Sorry, I don't have it working yet. But it looks like I will have some time now.

You're right that it won't be the first simulator, but it will be the first fully interactive simulator, I hope.

Thanks for pointing me to twisty.js. The "cuber" project only has a 3x3x3 model, and it hasn't proved easy to retrofit. I will work on hoisting cuber/ThreeTwist on top of twisty.js sometime soon.


----------



## mikebolt (May 15, 2016)

And, finally, here it is. It's still an early prototype, but it mostly works:

https://github.com/mikebolt/ThreeTwist

You can check out the demo links there for cubes of order 1 through 7. Here's a direct link to the 5x5x5 demo: https://mikebolt.github.io/ThreeTwist/examples/example_5.html

I recommend using Chrome, because there is a Firefox bug that causes incorrect depth ordering, and it runs smoother in Chrome anyway. However, anything higher than 7x7x7 runs somewhat slow on my computer at the moment. This is probably due to the increasingly large number of inner cubelets that are created and serving no purpose. This will be an easy fix. Hopefully this can go up to, say, 22x22x22, before crashing the browser. However, I would prefer lots of smaller cubes, like 3x3x3s, in the same page for the purposes of demonstrating algorithms. That's my next goal.

Oh, and by the way, you can go into the console and use the function cube.performStringAlgorithm(algorithm) to automatically perform an animated algorithm. It uses the alg.js algorithm parser, so it's basically SINGW notation.


----------



## bcube (May 24, 2016)

On Android on my Galaxy Ace 3 (using default browser, not Chrome) I see nothing but black screen for both 2x2x2, 3x3x3 and 5x5x5 :-(

Edit: as you already said, when using the same mobile device with Chrome, I can see the cube but can not play with it.

It looks very nice in desktop Chrome (newer one, in older one I see nothing but black screen). One user's not-so-cool feature is kind of bad rotation for smaller cubes (you have to drag the mouse very much if you ask me (see 2x2x2) - however, for bigger cubes this works fine).

For some players (not me, though) it could be distracting that vibration of a layer when not doing precise move, so the layer is not alligned entirely - it can be best seen on smaller cubes (2x2x2 - 4x4x4). (see snap parameter here: http://www.irbsystems.com/test2/rc/animcube_customization2.html) It seems that vibrations are present in Chrome but not in FF.

On IE 11 on desktop I see nothing but black screen, on FF 46 on desktop I see the cube with artefacts (maybe this issue could help? https://github.com/blonkm/rubiks-cube/issues/62 - although it is still open on Michiel's github).

"Please check if your phone's browser supports CSS3D by going here: http://caniuse.com/#feat=transforms3d."

Is there any indicator if my browser supports CSS3D? Because I see the same page for both my default browser and Chrome for my mobile device (and dektop with several browsers).

Nice work, especially in case of desktop Chrome


----------



## mikebolt (May 24, 2016)

bcube said:


> On Android on my Galaxy Ace 3 (using default browser, not Chrome) I see nothing but black screen for both 2x2x2, 3x3x3 and 5x5x5 :-(



So far I have only tested it with Chrome on desktop and Firefox on desktop. It works best with Chrome. No luck on Chrome for Android - it shows up but doesn't allow interaction.

Please check if your phone's browser supports CSS3D by going here: http://caniuse.com/#feat=transforms3d. If it doesn't, then that solves the mystery.


----------



## mikebolt (May 25, 2016)

You're right, that link is just a compatibility chart. Try viewing this page on your phone:

https://desandro.github.io/3dtransforms/examples/perspective-01.html

The colored boxes should look rotated if the browser supports CSS 3D transforms.

The cubes all rotate with the same speed. There's a constant somewhere in the code that controls the rotation speed. I will make that configurable with a parameter.

I think that I have mostly figured out the Firefox rendering problem, but it's different from the problem that GLube has.

The original Cuber project supported IE by using a different version of the renderer, but I removed it for testing purposes. It may be as simple as adding it back, but probably not. I might rewrite the renderer anyway.


----------



## bcube (May 25, 2016)

Thank you for that second link regarding testing that CSS 3D transforms. I can confirm you now that I can see those red and blue boxes rotated on my default browser on my mobile device.

"The original Cuber project supported IE by using a different version of the renderer, but I removed it for testing purposes. It may be as simple as adding it back, but probably not. I might rewrite the renderer anyway."

If you plan to run it on generally used browsers (such as Michael Feather did it with his AnimCubeJS, for example) that would be great. In any case, please keep me/us informed. I am very interested to see your development.

P.S. just to avoid possible confusion, by "kind of bad rotation for smaller cubes" I meant a cube rotation as a whole, not a rotation of single selected layer.


----------



## mikebolt (Jun 8, 2016)

After trying to fix the Firefox rendering bugs, I have become extremely frustrated with CSS 3D. It has poor performance and there's too many unfixed bugs in Firefox. I hope to move this project to WebGL with Three.js eventually. WebGL has great support in Firefox and most other browsers at this point and it has a much higher performance potential. Besides, I don't really need or want the ability to put links on stickers, anyway.

But there's a few other libraries that use WebGL and Three.js already, including Lucas Garron's twisty.js. I might work on improving twisty.js instead. However, he mentioned on Github that he might rewrite it anyway.

I think the best thing to do now would be to get some feedback. What features do people actually want? What should we focus on first? How should the API work? etc. Maybe I will create a survey, or a draft API, or both.


----------



## bcube (Jun 9, 2016)

Thank you for letting us know.

"What features do people actually want?"

Well, I would say everyone's taste differs. If you ask me, here is my list (see second half of that post): https://www.speedsolving.com/forum/threads/programmers-wanted.53140/#post-1081902

"What should we focus on first?"

If you ask me, I'm gonna say simulators for other puzzles. At first WCA puzzles such as Square-1, Megaminx or Pyraminx, but that is only my subjective opinion. 

As for NxNxN cubes, I haven't found yet a perfect simulator (for me) of 2x2x2, although Werner is pretty close to it.


----------



## bcube (Jun 19, 2016)

bcube said:


> As for NxNxN cubes, I haven't found yet a perfect simulator (for me) of 2x2x2...



Not true anymore.

I am happy to announce Michael Feather fulfilled my desires regarding the perfect 2x2x2 - 5x5x5 simulators with his AnimCubeJS.

Check out Micheal's website for simulator parameters (he even improved Josef Jelinek's code, on which AnimCubeJS is based on), his unique solving method he invented in 1980 (similar to HTA), his several cube solvers and much more interesting stuff.

Let you like it as much as I do .


----------

