I know a Rubik's cube is a puzzle in and of itself, but my question involves only a small part of a Rubik's cube.
Imagine you are holding a Rubik's cube and you are looking at the white face of the cube. If the cube is oriented such that the green face is on the right side, that will put the orange face on the bottom.
Now, assuming the cube is starting out solved and alternating between only 2 moves - spinning the green face down (toward you) and the orange face to the left, how many moves will it take to scramble and then resolve the cube? I just manually did it, so I know the answer, but this is the hard part - how can it be solved programmatically w/o using a loop and checking for a solved state after each move? After doing it manually it took this many moves to solve:
So, alternating between the 2 moves:
[ol][li]Spin right side face (green) down toward you[/li]
[li]Spin bottom side face (orange) to the left[/li]
[li]GOTO 1[/li][/ol]
How long does it take for the cube to resolve itself, and why?
-kaht
Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
Imagine you are holding a Rubik's cube and you are looking at the white face of the cube. If the cube is oriented such that the green face is on the right side, that will put the orange face on the bottom.
Code:
yellow (in back and hidden)
-------------
/ red /|
/ / |
|------------| |
| | green
blue | white | /
| | /
--------------/
orange
Now, assuming the cube is starting out solved and alternating between only 2 moves - spinning the green face down (toward you) and the orange face to the left, how many moves will it take to scramble and then resolve the cube? I just manually did it, so I know the answer, but this is the hard part - how can it be solved programmatically w/o using a loop and checking for a solved state after each move? After doing it manually it took this many moves to solve:
210
So, alternating between the 2 moves:
[ol][li]Spin right side face (green) down toward you[/li]
[li]Spin bottom side face (orange) to the left[/li]
[li]GOTO 1[/li][/ol]
How long does it take for the cube to resolve itself, and why?
-kaht
Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson