I wrote a 3d rubiks cube slot machine for my old online casino. It scrambled the cube randomly 4 times and gave the player 60 seconds to solve it by twisting up to 3 times. Lots of weird quaternion math to handle the spinning and shift key twisting at the same time. All with simple geometry in Away3D / AS3.
The real hard part of designing that game was creating the payout structure. The game paid an equal amount for each "line" of 3 colors in a row on any face after the player made their third move. There was a progressive take and jackpot for a perfect solution. And I specifically wanted to target a zero house edge for the game, to reward the best problem solvers. So the question was, given 4 random twists off a perfect cube, what are the individual chances of getting 64, 63, 62...1 lines of sequential color given the best 3 spins from the initial random state, and then hiw to allocate the payout structure accordingly.
Probably a billion monte carlo runs and I had a pay table. It was lots of fun. I wish more gambling games rewarded skill that way.
show comments
zetanor
Sweet, can I mint these as NFTs? I don't know how to multiply 43252003274489856000 by 50 USD but I think it could make me a lot of money, and I like money.
show comments
jcims
My scroll wheel covers about 12 states per inch of travel. Did the stubby pencil work and it would take about 9.5 years to scroll through them all if the wheel surface was moving at the speed of light.
show comments
dcanelhas
This is a nice visualization.
Are there any keyboard keys to just advance one position along the line? I tried the arrow keys but they jumped quite far.
I don't know how this was generated (BFS and flattening?) it seems adjacent indices aren't just one move apart ... but they could be!
The numbers produced by permutations are astounding! Especially compared to the (much smaller) numbers in our actual physical universe.
show comments
theginger
Anyone else surprised how small the number is?
It looks quite big without commas but if you add them in it looks like the sort of number that is almost conceivable
43,252,003,274,489,856,000
43 quintillion, that's the type of number i've vaguely heard of.
Compared to the number of possibilities for a shuffled deck of cards
80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,804,000,000,000,000
Thats a big number, and weirdly I think those 00s at the end are exact not a rounding error.
show comments
PaulHoule
Reminds me of that time when, as an undergraduate, my "team" entered a Problem Solving Competition and couldn't choose one of the two problems so we did both in parallel.
One of us wrote a program in BASIC on a Tandy 1000 that the rest of us estimated would take more than a google years to finish, but he wasn't be dissuaded and let it run the whole weekend.
I made an analysis that was mostly correct but was off by a factor of four because I mistook a radius for a diameter.
amelius
Maybe show the minimum number of moves required to solve each state :)
And maybe sort them by "distance to solved".
Waterluvian
Ah nice, it has some of my favourites!
show comments
arealaccount
> Application error: a client-side exception has occurred (see the browser console for more information).
On ios Firefox and Safari unfortunately, would love to see this site
danhardman
What's the correct way to sort a Rubik's Cube state?
olek1983
There are 43,252,003,274,489,856,000 (~4.3 × 10¹⁹) different positions.
1. If I try every position (1 position/sec) knowing it's unique, it will take me 1.37 trillion years.
2. If the pro tries (let's say 10 positions/sec), it will take 137 billion years.
The universe is younger than that. :-D
Wondering how fast the machine or computer will do that?
Wouldn't it be cool to click and then see the quickest solution and it rotates in front of you, or a sequence of moves to solve.
nzealand
It took Ernő Rubik four years to develop the cube.
He immediately scrambled it, then spent the next month figuring out if it could be solved.
Luckily no one told him there were 43 quintillion valid combinations.
show comments
netvarun
Wow, this was really fun to play around with! Amazing execution and launch!
Quick feedback: it’d be great if the page updated when the URL changes, so you can explore different positions without reloading.
Right now, if I change the URL/hash of the cube position (eg: incrementing by 1 https://everycube.alen.is/?view=3d#5319001606686939024
), the app doesn’t update and I have to open the new URL in a separate tab to see the new position. [Chrome 150 on Mac OS X 10.15.7]
show comments
cr125rider
I love this. Excellent weird internet thing.
kazinator
OK. So I put the slider into a random middle location. Then I zipped it back all the way left as fast as I could. Still not up to competitive speed cubing level! Shucks, golly, gee.
richstokes
First thought; this could be turned into a really cool password generator
purplemoonx
How did the kid who could solve the Rubik's Cube in under 1 min not become an algorithm designer - some genius backend dev?
I blame guitars.
All these kids got bad ass at playing Wonderwall, PHP was just slightly less cool than playing Wonderwall. So for 2-4 years they were sidetracked.
Playing Wonderwall at parties.
But if they had went straight from solving Rubik's Cube in 1 min to O(1) time complexity in a REST endpoint like peak 2-way communications (WebSocket, GRPC) these fuckers would be optimizing LLM embeddings at this point.
Karpathy? No, I want Steve from the Chess club who could recite any J.R.R. Tolkien writing, who has a Runescape character worth $4 million. Fuck LeCunn. Where's Steve?!
STEVE! I'm sorry I laughed at your Pokemon collection. I'm sorry Steve! I'm fucking sorry! PLEASE COME BACK
show comments
m4tthumphrey
This is very satisfying to play with, top work!
idorube
But, why?
jordanarseno
structure emerges from chaos at 23,738,673,083,197,685,761 & 34,677,398,788,068,093,945
show comments
ajkjk
well that's just like, your coordinate system, man
donkeylazy456
literally doom scrolling
show comments
skcurf
Cool!
pestatije
this does permutations of pieces position and orientation
would be cool permutations of moves instead...the visuals would be especially interesting to have as a raw Rubik's simulator
skcurf
cool!
tkocmathla
It would be really funny, and sociopathic, if every state change registered as a browser history entry so I had to click Back 50,000 times to get back to Hacker News.
show comments
maxlin
I think you missed at least a few, can you re-check through them?
khazhoux
At some point though, how many states is too many?
We have massive housing affordability and employment shortage problems, meanwhile here’s a tech elite flouting 4x10^9 states which he doesn’t pay taxes on and most of them will not even get used. Is that really fair?
I wrote a 3d rubiks cube slot machine for my old online casino. It scrambled the cube randomly 4 times and gave the player 60 seconds to solve it by twisting up to 3 times. Lots of weird quaternion math to handle the spinning and shift key twisting at the same time. All with simple geometry in Away3D / AS3.
The real hard part of designing that game was creating the payout structure. The game paid an equal amount for each "line" of 3 colors in a row on any face after the player made their third move. There was a progressive take and jackpot for a perfect solution. And I specifically wanted to target a zero house edge for the game, to reward the best problem solvers. So the question was, given 4 random twists off a perfect cube, what are the individual chances of getting 64, 63, 62...1 lines of sequential color given the best 3 spins from the initial random state, and then hiw to allocate the payout structure accordingly.
Probably a billion monte carlo runs and I had a pay table. It was lots of fun. I wish more gambling games rewarded skill that way.
Sweet, can I mint these as NFTs? I don't know how to multiply 43252003274489856000 by 50 USD but I think it could make me a lot of money, and I like money.
My scroll wheel covers about 12 states per inch of travel. Did the stubby pencil work and it would take about 9.5 years to scroll through them all if the wheel surface was moving at the speed of light.
This is a nice visualization. Are there any keyboard keys to just advance one position along the line? I tried the arrow keys but they jumped quite far.
I don't know how this was generated (BFS and flattening?) it seems adjacent indices aren't just one move apart ... but they could be!
There is a Hamiltonian circuit for Rubik's cube: https://bruce.cubing.net/ham333/rubikhamiltonexplanation.htm...
Following the circuit would be like Gray codes instead of binary digits. You only flip one bit at a time when going to the next number.
Reminds me of a book I recently read:
https://en.wikipedia.org/wiki/A_Short_Stay_in_Hell
The numbers produced by permutations are astounding! Especially compared to the (much smaller) numbers in our actual physical universe.
Anyone else surprised how small the number is? It looks quite big without commas but if you add them in it looks like the sort of number that is almost conceivable 43,252,003,274,489,856,000 43 quintillion, that's the type of number i've vaguely heard of. Compared to the number of possibilities for a shuffled deck of cards 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,804,000,000,000,000 Thats a big number, and weirdly I think those 00s at the end are exact not a rounding error.
Reminds me of that time when, as an undergraduate, my "team" entered a Problem Solving Competition and couldn't choose one of the two problems so we did both in parallel.
One of us wrote a program in BASIC on a Tandy 1000 that the rest of us estimated would take more than a google years to finish, but he wasn't be dissuaded and let it run the whole weekend.
I made an analysis that was mostly correct but was off by a factor of four because I mistook a radius for a diameter.
Maybe show the minimum number of moves required to solve each state :)
And maybe sort them by "distance to solved".
Ah nice, it has some of my favourites!
> Application error: a client-side exception has occurred (see the browser console for more information).
On ios Firefox and Safari unfortunately, would love to see this site
What's the correct way to sort a Rubik's Cube state?
There are 43,252,003,274,489,856,000 (~4.3 × 10¹⁹) different positions. 1. If I try every position (1 position/sec) knowing it's unique, it will take me 1.37 trillion years. 2. If the pro tries (let's say 10 positions/sec), it will take 137 billion years. The universe is younger than that. :-D
Wondering how fast the machine or computer will do that?
Reminds me of https://everyuuid.com/
This is pretty cool. Same concept (and I would assume implementation) as https://everyuuid.com/
Implementation details can be found here: https://eieio.games/blog/writing-down-every-uuid/
Wouldn't it be cool to click and then see the quickest solution and it rotates in front of you, or a sequence of moves to solve.
It took Ernő Rubik four years to develop the cube.
He immediately scrambled it, then spent the next month figuring out if it could be solved.
Luckily no one told him there were 43 quintillion valid combinations.
Wow, this was really fun to play around with! Amazing execution and launch!
Quick feedback: it’d be great if the page updated when the URL changes, so you can explore different positions without reloading.
Right now, if I change the URL/hash of the cube position (eg: incrementing by 1 https://everycube.alen.is/?view=3d#5319001606686939024 ), the app doesn’t update and I have to open the new URL in a separate tab to see the new position. [Chrome 150 on Mac OS X 10.15.7]
I love this. Excellent weird internet thing.
OK. So I put the slider into a random middle location. Then I zipped it back all the way left as fast as I could. Still not up to competitive speed cubing level! Shucks, golly, gee.
First thought; this could be turned into a really cool password generator
How did the kid who could solve the Rubik's Cube in under 1 min not become an algorithm designer - some genius backend dev?
I blame guitars.
All these kids got bad ass at playing Wonderwall, PHP was just slightly less cool than playing Wonderwall. So for 2-4 years they were sidetracked.
Playing Wonderwall at parties.
But if they had went straight from solving Rubik's Cube in 1 min to O(1) time complexity in a REST endpoint like peak 2-way communications (WebSocket, GRPC) these fuckers would be optimizing LLM embeddings at this point.
Karpathy? No, I want Steve from the Chess club who could recite any J.R.R. Tolkien writing, who has a Runescape character worth $4 million. Fuck LeCunn. Where's Steve?!
STEVE! I'm sorry I laughed at your Pokemon collection. I'm sorry Steve! I'm fucking sorry! PLEASE COME BACK
This is very satisfying to play with, top work!
But, why?
structure emerges from chaos at 23,738,673,083,197,685,761 & 34,677,398,788,068,093,945
well that's just like, your coordinate system, man
literally doom scrolling
Cool!
this does permutations of pieces position and orientation
would be cool permutations of moves instead...the visuals would be especially interesting to have as a raw Rubik's simulator
cool!
It would be really funny, and sociopathic, if every state change registered as a browser history entry so I had to click Back 50,000 times to get back to Hacker News.
I think you missed at least a few, can you re-check through them?
At some point though, how many states is too many?
We have massive housing affordability and employment shortage problems, meanwhile here’s a tech elite flouting 4x10^9 states which he doesn’t pay taxes on and most of them will not even get used. Is that really fair?
Non-AI posts be like