*----------------*
| Up (Red) |
*--------------+----------------+---------------*-------------*
|Left (Orange) | Front (Yellow) | Right (Green) | Back (Blue) |
*--------------+----------------+---------------*-------------*
| Down (Indigo) |
*----------------*
Any possible transformation of the cube can be described in terms of a
series of 90-degree clockwise rotations. "Clockwise" means the usual
clockwise direction while looking at the face to be rotated. The input consists of one or more lines. Each line describes a sequence of rotations, each of which is denoted by a face letter (one of U, D, L, R, F, and B). For example, B denotes a 90-degree clockwise rotation of the back face. The letters are consecutive, with no intervening whitespace. For each line of input, start with the cube in the initial configuration shown above, apply the designated sequence of rotations, then output a picture of the up, front and right faces as shown in the example below. Each letter in the picture represents the color of the corresponding square. In a picture, the uppermost face is the "Up" face, the leftmost face is the "Front" face and the rightmost face is the "Right" face.
Input must be read from the file "prob6.in", and output must be
written to the file "prob6.out". All output to the screen will be
ignored.
<BOF> RUFD <EOF>
R
R R
O R R
O R
Y I B
Y B
Y G Y G
Y G
O G Y G
O I
B I
Dr. Eric Shade