3x3x3 simulator in 745 bytes of javascript

User experience anyone?

There are other sims with better usability if you need that.

Just because this is hard to use does not mean that it is not a sim.

You don't have a valid complaint.

If the algorithms used to solve a rubik's cube cannot be used to solve this, how can it be considered a sim?

You can use algorithms like normal? You're making out like it's a different puzzle or something.

U = Up
D = Down Down Up Down Down
F = Down Down Down Up Down
B = Down Up Down Down Down
R = Right Down Down Down Up Down Right Right Right
L = Right Right Right Down Down Down Up Down Right

Here are the controls, it supports every move.
 
Last edited by a moderator:
There are other sims with better usability if you need that.

Just because this is hard to use does not mean that it is not a sim.

You don't have a valid complaint.

My argument is not the "difficulty", it is that because of the restrictions on movement, the user experience isn't remotely comparable with that of solving a cube. That I don't possess the knowledge to solve this "sim" isn't a reflection on it's difficulty, but instead that the knowledge required is different.
 
My argument is not the "difficulty", it is that because of the restrictions on movement, the user experience isn't remotely comparable with that of solving a cube.

Did you see my above post? You can even see me solve the damn thing with CFOP, busting out Sunes and **** in my video.

That I don't possess the knowledge to solve this "sim" isn't a reflection on it's difficulty, but instead that the knowledge required is different.

What different knowledge is required? You just solve it the same way you solve any cube or sim, it just has a weird control scheme and a confusing display.
 
Yeah, having solved a version of this puzzle (the one with the graphical display) I can confirm that you do use the same techniques and algorithms as with a regular cube. It is just more difficult to get it to do the move you want to do (and to recognize stuff). It's not actually a restriction on the puzzle, just a very inefficient control scheme.


Back to Stefan's complaints, I think I feel like the best part of these sims is their small size. To me, a shorter sim is more impressive and more interesting, even if it doesn't have as many features as the longer one, and is further in functionality from a real program. A lot of the fun for me is seeing how much you can strip down and still be able to say that, yes, it is still an interactive program that simulates the puzzle. I guess I can see where Stefan is coming from but I feel like when you are adding features back in and increasing the size of the puzzle the activity changes from code golf to software-development. And if I'm going to be doing that I'd rather work on a good sim.
 
I agree that /we/ are simulating the turn, but disagree that it is not a simulator.

I didn't say it's not a simulator, I said it's not a Rubik's Cube simulator. And I'm sticking to that. I dismiss your "L is there it's just Right Right Right Down Down Down Up Down Right". Like I said before, it's "a fundamental move on the real cube" and it simply isn't on the sim.

For me, it's good enough that it reaches every position and can be fully scrambled and solved (also that is has some kind of visual output).

Let's represent each state with a number from 0 to 43252003274489855999 and on key up, increase that number by 1 modulo 43252003274489856000? Awesome?

You can even see me solve the damn thing with CFOP, busting out Sunes and **** in my video.

I'm doubt we can. Sure, I can watch the video and I see letters jumping around, but it's probably impossible to follow. We can't even follow your skype teamblind instructions on cubecast! Fun stat: youtube stats say 196 views and 3 hours, so about 1 minute per view. I claim nobody actually tried to understand anything going on in that video :p

Back to Stefan's complaints, I think I feel like the best part of these sims is their small size. To me, a shorter sim is more impressive and more interesting, even if it doesn't have as many features as the longer one, and is further in functionality from a real program. A lot of the fun for me is seeing how much you can strip down and still be able to say that, yes, it is still an interactive program that simulates the puzzle. I guess I can see where Stefan is coming from but I feel like when you are adding features back in and increasing the size of the puzzle the activity changes from code golf to software-development. And if I'm going to be doing that I'd rather work on a good sim.

I get your point as well, but in the case of the 15-puzzle, a version without good scrambling is in my opinion simply missing something. Exactly what the "real" version is missing and why I don't like it. Ok, it's a full simulation of the real one that way, but that's a full simulation of something bad. Also, it's not like we've never code-golfed scramblers, and I thought this one might be interesting as well.
 
I didn't say it's not a simulator, I said it's not a Rubik's Cube simulator. And I'm sticking to that. I dismiss your "L is there it's just Right Right Right Down Down Down Up Down Right". Like I said before, it's "a fundamental move on the real cube" and it simply isn't on the sim.

I disagree. The only problem with doing 'fundamental moves' is you have to move the side you want to turn to the top first.

Let's represent each state with a number from 0 to 43252003274489855999 and on key up, increase that number by 1 modulo 43252003274489856000? Awesome?

What if I want to use a method other than the devil's algorithm? Can you tell me the controls for U, F, R, B, L and D?

I'm doubt we can. Sure, I can watch the video and I see letters jumping around, but it's probably impossible to follow.

Carson seemed to think that you needed to use a different method to solve the cube for some reason. I was pointing out that you just use normal methods to solve this.

Also, I can follow what is happening in the video. It's quite easy to visualise the 3x3x3 once you get used to it.
 
I disagree. The only problem with doing 'fundamental moves' is you have to move the side you want to turn to the top first.

Which you don't have to do with the real one.

What if I want to use a method other than the devil's algorithm? Can you tell me the controls for U, F, R, B, L and D?

Not sure. It's either something simple like "For L press space 482375920 times" or it might depend on the state like "For L press space N(S) times, where S is the current state", with N being some kind of table/function.

Anyway, you said "For me, it's good enough that it reaches every position and can be fully scrambled and solved (also that is has some kind of visual output)" and I think my suggestion does fulfill those requirements and thus should be good enough for you.

Carson seemed to think that you needed to use a different method to solve the cube for some reason.

Ah, ok. Didn't sound like that to me.

Also, I can follow what is happening in the video. It's quite easy to visualise the 3x3x3 once you get used to it.

I don't think I'd want to get used to that :). Also, you still have the advantage of knowing your algs/style.
 
Which you don't have to do with the real one.

You don't have to press keys on a real cube either.

Not sure. It's either something simple like "For L press space 482375920 times" or it might depend on the state like "For L press space N(S) times, where S is the current state", with N being some kind of table/function.

Anyway, you said "For me, it's good enough that it reaches every position and can be fully scrambled and solved (also that is has some kind of visual output)" and I think my suggestion does fulfill those requirements and thus should be good enough for you.

I don't know how to solve it until I know the controls.

I don't think I'd want to get used to that :). Also, you still have the advantage of knowing your algs/style.

You don't have to get used to it, it's not designed to be actually used. I'm also quite sure I could follow someone else's solve.
 
Let's represent each state with a number from 0 to 43252003274489855999 and on key up, increase that number by 1 modulo 43252003274489856000? Awesome?

I know a smiliar variant, yet easier to implement:
Cube = 123456789AB1234567000000000000000000
(In the order of EP-CP-EO-CO, 18 cubies)
And you can define <U,x,y> with permutations along the numbers, with orientations as additions modulo 3 or modulo 2. So, a scrambled cube for example:
Scrambled cube = 46432A1B9783254176010010010112102101

Here, a cube sim. Awesome. :)
 
Renslay,
That would be a really cool human thistlewaite/kociemba sim! I'd love to play with that (if I had full controls, not this <U,x,y> stuff).

I'm definitely on the side that 1 keypress should be 1 move to be considered a /full/ sim. But these aren't full sims, so...
 
Here's a new challenge (for the 3x3x3 only) then:
- Sim must display all 54 stickers, with faces in a cube net and each face composed of a three by three array of stickers (although you can choose how to display each sticker)
- Each of the 6 turns must be able to be done with some single keypress or mouse click

PS: Stefan, if you want to write a random-state scrambler for the 15puzzle, go ahead, I'd like to see it. As I said, though, I had trouble thinking about how to work around those newlines. It might be easier to store h without newlines and then do something like this:
Code:
v="";g=h;while(g.length>0)v+=g.splice(0,4)+"<br/>";document.body.innerHTML=v
 
Stefan, if you want to write a random-state scrambler for the 15puzzle, go ahead, I'd like to see it. As I said, though, I had trouble thinking about how to work around those newlines. It might be easier to store h without newlines and then do something like this:
Code:
v="";g=h;while(g.length>0)v+=g.splice(0,4)+"<br/>";document.body.innerHTML=v

Can certainly be improved, but at least I think it works: 313

Also improved your ?:?:?:?: term by using & instead of && where possible and q>3 instead of q==4.
 
Last edited:
Here's a new challenge (for the 3x3x3 only) then:
- Sim must display all 54 stickers

I think just requiring at least 27 stickers is a more accurate "realistic simulation", since you can only normally see at most 3 sides of a cube simultaneously.
(Although seeing the other sides wouldn't hurt)

Back when I was first learning Java, I made a sim (with almost the same controls as hi-games) that only shows 3 sides, and I could still get solves on it relatively close to my times on a real cube. (if you download it, don't click on the cube/canvas, or the keyboard will stop working... I never did try to figure out why it did that)
 

Attachments

I know a smiliar variant, yet easier to implement:
Cube = 123456789AB1234567000000000000000000
(In the order of EP-CP-EO-CO, 18 cubies)
And you can define <U,x,y> with permutations along the numbers, with orientations as additions modulo 3 or modulo 2. So, a scrambled cube for example:
Scrambled cube = 46432A1B9783254176010010010112102101

How is that easier to implement than basically
onkeyup=function(){innerHTML=i=(i+1)%43252003274489856000}
?
 
Last edited:
Very nice. I recommend changing FA0 to something like F50 (the current orange and yellow confuses me).
 
Back
Top