Problem 882. Solve Rubik's Cube - One Rotation
A standard Rubik's Cube is shown in 3-D and also unfolded to identify the specific Tile-face/Vector numbering.
The faces are White-Up / Red-Left / Blue-Front / Orange-Right / Yellow-Down / Green-Back (ULFRDB)
Moves are denoted as F for clockwise rotation of the Front face. F' is CCW and F2 is F twice. The loaded function r_new=rubick_rot(mov,r) implements moves 1-18: UFDLBRU'F'D'L'B'R'U2F2D2L2B2R2.



Input: (rubik)
rubik: row vector of size 54 (The cube started [L=0,U=1,F=2,D=3,B=4,R=5] and then receives one face move.
Output: mov (A single value that solves the cube, 1:18) mov: is an integer 1:18 representing the moves in order: UFDLBRU'F'D'L'B'R'U2F2D2L2B2R2
The function rubik_rot(mov,r) is available for usage
Additional Challenges will be solving the cube at even deeper depths for time and minimizing face moves utilized.
- This easiest Rubik's Cube challenge is solely to whet everyone's appetite.
- The superflip will have to wait for a later challenge.
- Cube Theory: 20-moves Any Cube
Note: Images inserted/linked to my free google web page. Used a gif and a png.
Solution Stats
Problem Comments
-
2 Comments
Re-linked rubik_rot.m from a permanent good location
The test-suite seems corrupted. I get the following error, which does not seem to be related to my function. Btw, the test runs successfully on my computer.
File: rubik_rot.m Line: 1 Column: 1 Invalid use of operator. Error in Test2 (line 11) r=rubik_rot(mov,r); % Create Challenge Cube
Solution Comments
Show commentsGroup

Matrix Patterns I
- 18 Problems
- 60 Finishers
- Pascal's Matrix
- Spot the rectangle (Part 2)
- Spot the rectangle
- Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
- Magic is simple (for beginners)
- Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
- Mirror Image matrix across anti-diagonal
- Special matrix
- Make a logical diamond using GALLERY function
- Magic is simple (for beginners)
- Create a Multiplication table matrix...
- Make a Star Pyramid
- "mirror" matrix
- Twist 'n' Match
- Create a matrix X, where each column is a shifted copy of the vector v
- Symmetric matrix
- Create a patchwork matrix
- Spiral In
- Spot the rectangle (Part 2)
- Spot the rectangle
- Matrix spiral
- Better bullseye matrix
Problem Recent Solvers8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!