1d Rubiks Cube

Snap! 1d Rubiks Cube
try to go as fast as possible

Very cool concept! I was able to figure out how to solve it pretty quickly, and the controls are self-explanable; you can find it out yourself. Good job!

this is a cool little concept, took me a minute to figure it out but i like it a lot

it’d seem more like a rubik’s cube if the numbers were colors instead, but this is still awesome

you can also play it irl:
get pieces of paper
put numbers or colors on them
and move them around by either moving one to the other side or swapping the two
i would show a video of me doing it in paint but i dont know how to add a video
oh hey i figured it out

oh that’s interesting! thanks for telling me!

Nice.

You can shuffle the digits by just saying
1d Rubiks Cube script pic

I don’t understand how the << and >> buttons work, because I don’t see anywhere in your code where Took is rejoined to Line. :~/

sorry I think I did that before shuffled exists, also maybe look in some blocks I don’t know why I made it this way

The << button shifts the digits left, while the >> button shifts them right. The <> button swaps the first and last digits.

how did you solve it

It’s hard to explain. I will try my best,

First, I locate zero. I then locate one. I get it so then 1 is the left-most number, and then I swap. I shift the digits right, so one is the left-most number again. I repeat this process until 1 is to the right of 0. I do this for every number until I solve it.

thats what I do, did you read the algorithm comment or came up with that yourself

There was an algorithm comment? I didn’t know that. I just kind of stumbled upon the solution algorithm

yes in the project, but also cool you came it up yourself

IMO the solved state should be 0123456789.

it is…??

Yeah but it is a bit strange. You first have to move it onto 0123456789, but then you have to move off of it, making it seem like the solution is either 1234567890 or 234567801

no it actually has to wait it just shows the win before it says you won