Scripts/1D Rubik's Cube
< Scripts
Jump to navigation
Jump to search
Here's an interesting game, found on Andrew Nikitin's MSX-BASIC page http://nsg.upor.net/msx/basic/basic.htm .
1D Rubik's Cube is a line of 6 numbers with original position:
1 2 3 4 5 6
which can be rotated in 3 different ways in groups of four:
_______ _______ (1 2 3 4)5 6 --(0)-> (4 3 2 1)5 6 _______ _______ 1(2 3 4 5)6 --(1)-> 1(5 4 3 2)6 _______ _______ 1 2(3 4 5 6) --(2)-> 1 2(6 5 4 3)
Given a scrambled line, find the shortest sequence of rotations to restore the original position.
See Also
- Puzzle and solutions at J Forum JForum:programming/2007-June/007004
- Scripts/Text UI
Contributed by Oleg Kobchenko
[[Category:Scripts R.7]