Rubik's Cube/Finishing the Orientation of Corner Cubies

 +-+ +-+ 
 * HOW TO FIND YOUR VERY OWN PERSONAL WAYS TO SOLVE RUBIK'S CUBE                              |
 * (Preliminary April 20, 2007 version)            |
 * by Mr. Ray Calvin Baker                         |
 * FREE Educational Materials                      |
 * Chapter Seven - - - - - - - - - Finishing the Orientation of Corner Cubies                 |
 * In Chapter Five, we found some new patterns for rotating corner cubies. Each pattern is a  |
 * (coded) solution for \i some\i0 Rubik's Cube problem.                                      |
 * Can you find these patterns?                                                               |
 * + 0 + 0 +    - + - + -     0 + 0 + 0     0 - 0 - 0     0 0 0 0 0     Some sample      |
 * - 0 - 0 -    + + + 0 +     0 + 0 0 0     0 0 0 - 0     0 + 0 - 0     problems.        |
 * [F] [K]      [F] [K]       [F] [K]       [F] [K]       [F] [K]                      |
 * DIAGRAM 7-1. Typical Coded Rotation Problems                                          |
 * These last two patterns, or variations of them, will solve ALL problems af rotated corner  |
 * cubies (unless your cube has been physically damaged.) Yes, there are simpler ways -- can  |
 * you find some?                                                                             |
 * We now have tools which will enable us to find a way to rotate just TWO corner cubes (in   |
 * opposite directions). Let's work out a detailed plan to do this.                           |
 * Starting with a Cube with all eight corner cubies in their proper locations is essential   |
 * for completing this chapter. The orientations of these eight corner cubies has not yet     |
 * determined -- it can be completely arbitrary, within the constraints imposed by the        |
 * essential geometry of the Cube itself. (If seven corner cubies are properly located and    |
 * oriented, then the eighth corner cubie is also properly located and oriented -- unless your |
 * Cube has been physically damaged or is "out of orbit".)                                    |                                           |                                                                                             |
 * Since we are still doing "paper and pencil" work, we can start with an arbitrary config-   |
 * uration of properly located corner cubies. Let's start with                                |
 * 0 0 0 0 0                                                                            |
 * 0 0 0 0 0                                                                            |
 * [F] [K].                                                                           |
 * From our work in chapter five, we know that this sequence of moves changes the orientation |
 * of six corner cubies (but it doesn't change their locations).                              |
 * 0 0 0 0 0    Fv R^ Fv R^ Fv R^     0 + - - 0                                         |
 * 0 0 0 0 0    -> -> -> -> -> ->     0 + + - 0                                         |
 * [F] [K]                            [F] [K]                                         |
 * DIAGRAM 7-2. A Sequence of Moves Which Changes Orientations od Corner Cubies         |
 * If we do that again, we have this.                                                         |
 * 0 + + - 0    Fv R^ Fv R^ Fv R^     0 - + + 0                                         |
 * 0 + - - 0    -> -> -> -> -> ->     0 - - + 0                                         |
 * [F] [K]                            [F] [K]                                         |
 * DIAGRAM 7-3. Repeating the Sequence of Moves                                         |
 * We expect that, if we do it a third time, everything will cancel out, and we will be right |
 * back at the starting configuration -- not very useful! But what if we could fix things so  |
 * that not everything cancels out? Let's try an experiment.                                  |
 * 0 - + + 0   Fv    0 - - + 0    Fv R^ Fv R^ Fv R^    0 0 + 0 0    F^    0 + - 0 0       |
 * 0 - - + 0   ->    0 - + + 0    -> -> -> -> -> ->    0 0 - 0 0    ->    0 0 0 0 0       |
 * [F] [K]           [F] [K]                           [F] [K]            [F] [K]       |
 * DIAGRAM 7-4. A Sucessful Experiment                                                    |
 * This can be extremely useful! Just be careful to have your Cube precisely oriented before  |
 * you start the sequence of moves. The corner cubie at FRONT LEFT TOP will be rotated        |
 * counterclockwise, and the corner cubie at FRONT RIGHT TOP will be rotated clockwise. (Hint: |
 * there may be a useful way to turn your Cube 180 degrees if you need to do this.)           |
 * How do you solve this problem?                                                             |
 * Step              Step two:                            Step                  |
 * one:              (You know how!)                      three:                |
 * 0 0 + 0 0   L^    0 - + 0 0      Fv R^ Fv R^ Fv R^      0 0 0 0 0   Lv    0 0 0 0 0      |
 * 0 - 0 0 0  --->   0 0 0 0 0      Fv R^ Fv R^ Fv R^      0 0 0 0 0  --->   0 0 0 0 0      |
 * [F] \{K\}           [F] [K]   Fv Fv R^ Fv R^ Fv R^ F^     [F] [K]           [F] [K]    |
 * A Problem!                                                                  Solved!      |
 * DIAGRAM 7-5. Solving a Typical Problem                                                   |
 * NOTE: Step one, a one-layer turn, moves four corner cubies away from their proper          |
 * locations. Therefore, it is very important not to forget to do step three, another one-    |
 * layer move, in order to return those four corner cubies to their proper places. There are a |
 * lot of details not shown in the above simplified diagrams!                                 |
 * We can also demonstrate that knowing how to rotate two corner cubies in opposite directions |
 * will allow us to solve the problem of three corner cubies all rotated in the same          |
 * direction. See if you can follow this sequence of moves.                                   |
 * 0 0 0 0 0 ROTATE  0 - + 0 0  ROTATE  0 + - 0 0  3Tv  + - 0 0 0  ROTATE   + + + 0 0        |
 * 0 0 0 0 0   TWO   0 0 0 0 0    TWO   0 0 0 0 0  -->  0 0 0 0 0    TWO    0 0 0 0 0        |
 * [F] [K] CORNERS   [F] [K]  CORNERS   [F] [K]         [F] [K]  CORNERS    [F] [K]        |
 * DIAGRAM 7-6. Solving Three Corners Rotated in Same Direction                              |
 * At this time, you should be able to pick up your Cube and rotate all eight corner cubies   |
 * into their proper orientation. You should be able to accomplish Goal Two. Basically, there |
 * are three ways to do this.                                                                 |
 * The first way is, "everything all at once". You have tools to make lots of diagrams of     |
 * patterns of rotation for the corner cubies. You should be able to make a diagram of your   |
 * partially unscrambled Cube. You should be able to determine what pattern will rotate the   |
 * corner cubies to their proper orientation.                                                 |
 * Here's an example of what I mean by this. Suppose your Cube has this pattern:              |
 * 0 0 + + +  What pattern will     0 0 - - -         For each "0" in the problem,          |
 * + - 0 - +  solve this problem?   - + 0 + -            write "0" in the solution.         |
 * A possible                       The pattern       For each "+" in the problem,          |
 * problem.                         that solves it.      write "-" in the solution.         |
 * For each "-" in the problem,         |
 * write "+" in the solution.        |
 * DIAGRAM 7-7. Find a Solution For a Rotation Problem                                      |
 * Now, all you need to do is find this solution in your notebook (You did make a notebook,   |
 * didn't you?) and apply it to your Cube (You did record the moves to make your patterns,    |
 * didn't you?). The advantage of "everything all at once" is that it gives you an immediate  |
 * sequence of moves to complete fixing all eight corner cubies. The disadvantages are (1) you |
 * must have lots of good, accurate notes -- there are (3 to the 8th power) / 3 = 2,187       |
 * possible patterns, and (2) I can't remember 2,187 moves, or even what the next             |
 * disadvantage was.                                                                          |
 * The second method is, "one or two cubies at a time". This is easy to memorize, but slow -- |
 * you may have to use this method up to seven times. Diagrams 7-2, 7-3, and 7-4 show how to  |
 * rotate two corner cubies in opposite directions. So, find two corner cubies which are not  |
 * oriented properly, move them into position (step 1 of customizing), rotate the two corners, |
 * and undo step 1 (step 3 of customizing). One more, or possibly two more, corner cubies     |
 * should now be correctly oriented. Keep doing this until all eight corners are correctly    |
 * oriented.                                                                                  |
 * The third way is to use a combination of methods -- find a rotation pattern that matches   |
 * several corners of your required solution, apply it, then clean up any remaining problems  |
 * using the "one or two cubies at a time" method.                                            |
 * The second and third methods are something fairly easy to remember and use. If you can     |
 * finish this phase of the solution by yourself, that's great! If you need the help of a     |
 * recipe to do this, here it comes.                                                          |
 * But first, I need to show you another diagram. You may use this diagram to find the        |
 * "customization" moves you need.                                                            |
 * Case 1: ?? #1 #2 ?? ?? No customization is needed.                                    |
 * [F]  [K]                                                                  |
 * Case 2: ?? #1 ?? #2 ?? Customize by doing "R^".                                       |
 * [F]  [K]                                                                  |
 * Case 3: #2 #1 ?? ?? #2 Customize by doing "3T^".                                      |
 * [F]  [K]                                                                  |
 * Case 4: ?? #1 ?? ?? ?? Customize by doing "K^ 3T^".                                   |
 * #2 ?? ?? ?? #2                                                                |
 * [F]  [K]                                                                  |
 * Case 5: ?? #1 ?? ?? ?? Customize by doing "3Fv".                                      |
 * ?? #2 ?? ?? ??                                                                |
 * [F]  [K]                                                                  |
 * Case 6: ?? #1 ?? ?? ?? Customize by doing "Rv".                                       |
 * ?? ?? #2 ?? ??                                                                |
 * [F]  [K]                                                                  |
 * Case 7: ?? #1 ?? ?? ?? Customize by doing "R2".                                       |
 * ?? ?? ?? #2 ??                                                                |
 * [F]  [K]                                                                  |
 * DIAGRAM 7-8. Find Second Corner Cubie to Rotate, Then Apply These Moves               |
 * While looking at diagram 7-8, you may have thought that there are often several different  |
 * ways to "customize". You are correct. Pick one way -- whatever you feel comfortable with -- |
 * and stick with it. Just don't change your mind part way through the three-step process.    |
 * Paragraph A:                                                                               |
 * Find a corner cubie which is properly located, but not properly oriented. Call this cubie  |
 * "#1". Rotate the entire Cube until this cubie is located at the FRONT LEFT TOP corner. Find |
 * another corner cubie which is also not properly oriented. There are seven possibilities, as |
 * shown in diagram 7-8. Follow the directions to "customize" your moves, then perform the    |
 * sequence,                                                                                  |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv Fv R^ Fv R^ Fv R^ F^.                                                |
 * Paragraph B:                                                                               |
 * It is possible that no improvement resulted from performing paragraph A, because both      |
 * corner cubies were rotated in the wrong direction. If the corner cubie in the FRONT LEFT   |
 * TOP position is still not correcxtly oriented, simply repeat this sequence again,          |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv Fv R^ Fv R^ Fv R^ F^.                                                |
 * _ * _                                       _ * _                 |
 * _ * _  _ * _                                _ * _   _ * _             |
 * _ * _  _ * _   _ * _                        _ * _   _ * _   _ * _         |
 * * _ T _ * _ T _ * _  _ *                    * _ l _ * _ T _ * _   _ *       |
 * (L)...|  * _   _ * _   _ *   |              (f)...|   * _   _ * _   _ *   |       |
 * | F |  * _#2 _ *   |   |                    | t |   * _#2 _ *   |   |       |
 * The      * _ |   |   *   |   | _ *          The       * _ |   |   *   |   | _ *       |
 * FRONT    |   * _ |#2 |#2 | _ *   |          FRONT     |   * _ |#2 |#2 | _ *   |       |
 * LEFT     |   |   * _ | _ *   |   |          LEFT      |   |   * _ | _ *   |   |       |
 * TOP      * _ | F |   *   | R | _ *          TOP       * _ | F |   *   | R | _ *       |
 * cubie    |   * _ |   |   | _ *   |          cubie     |   * _ |   |   | _ *   |       |
 * is       |   |   * _ | _ *   |   |          needs     |   |   * _ | _ *   |   |       |
 * correctly * _ |  |   *   |   | _ *          more      * _ |   |   *   |   | _ *       |
 * oriented;    * _ |   |   | _ *              work;         * _ |   |   | _ *           |
 * go on to         * _ | _ *                  repeat the        * _ | _ *               |
 * paragraph C.         *                      sequence of moves.    *                   |
 * DIAGRAM 7-9A.                               DIAGRAM 7-9B.                             |
 * DIAGRAM 7-9. Is the FRONT LEFT TOP Corner Cubie Properly Oriented?                    |
 * Paragraph C:                                                                               |
 * Undo the customization you used in paragraph A. (You do remember what you did, don't you?) |
 * Paragraph D:                                                                               |
 * If all eight corner cubies are properly positioned and properly oriented, you are done!    |
 * Otherwise, repeat this process (starting at paragraph A) until all eight corner cubies are |
 * properly oriented.                                                                         |
 * 1) How much progress have we made at the end of chapter seven? There are now only              #
 * 2) ( ( 12 factorial) * (2 to the 12th power) / 4 ) = 479,001,600 * 4,096 / 4 =                 #
 * 3) 490,497,638,400 ways to arrange the cubies of your Cube.                                    #
 * By the way, you should now be able to see a pretty "X" pattern of matching cubies on all   |
 * six sides of your Cube.                                                                    |
 * |TOP| ? |TOP|                                                  |
 * | ? |TOP| ? |                                                  |
 * |TOP| ? |TOP|                                                  |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | ? | L | ? | ? | F | ? | ? | R | ? | ? | K | ? |                          |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | B | ? | B |                                                  |
 * | ? | B | ? |                                                  |
 * | B | ? | B |                                                  |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv Fv R^ Fv R^ Fv R^ F^.                                                |
 * Paragraph B:                                                                               |
 * It is possible that no improvement resulted from performing paragraph A, because both      |
 * corner cubies were rotated in the wrong direction. If the corner cubie in the FRONT LEFT   |
 * TOP position is still not correcxtly oriented, simply repeat this sequence again,          |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv R^ Fv R^ Fv R^                                                    |
 * Fv Fv R^ Fv R^ Fv R^ F^.                                                |
 * _ * _                                       _ * _                 |
 * _ * _  _ * _                                _ * _   _ * _             |
 * _ * _  _ * _   _ * _                        _ * _   _ * _   _ * _         |
 * * _ T _ * _ T _ * _  _ *                    * _ l _ * _ T _ * _   _ *       |
 * (L)...|  * _   _ * _   _ *   |              (f)...|   * _   _ * _   _ *   |       |
 * | F |  * _#2 _ *   |   |                    | t |   * _#2 _ *   |   |       |
 * The      * _ |   |   *   |   | _ *          The       * _ |   |   *   |   | _ *       |
 * FRONT    |   * _ |#2 |#2 | _ *   |          FRONT     |   * _ |#2 |#2 | _ *   |       |
 * LEFT     |   |   * _ | _ *   |   |          LEFT      |   |   * _ | _ *   |   |       |
 * TOP      * _ | F |   *   | R | _ *          TOP       * _ | F |   *   | R | _ *       |
 * cubie    |   * _ |   |   | _ *   |          cubie     |   * _ |   |   | _ *   |       |
 * is       |   |   * _ | _ *   |   |          needs     |   |   * _ | _ *   |   |       |
 * correctly * _ |  |   *   |   | _ *          more      * _ |   |   *   |   | _ *       |
 * oriented;    * _ |   |   | _ *              work;         * _ |   |   | _ *           |
 * go on to         * _ | _ *                  repeat the        * _ | _ *               |
 * paragraph C.         *                      sequence of moves.    *                   |
 * DIAGRAM 7-9A.                               DIAGRAM 7-9B.                             |
 * DIAGRAM 7-9. Is the FRONT LEFT TOP Corner Cubie Properly Oriented?                    |
 * Paragraph C:                                                                               |
 * Undo the customization you used in paragraph A. (You do remember what you did, don't you?) |
 * Paragraph D:                                                                               |
 * If all eight corner cubies are properly positioned and properly oriented, you are done!    |
 * Otherwise, repeat this process (starting at paragraph A) until all eight corner cubies are |
 * properly oriented.                                                                         |
 * 1) How much progress have we made at the end of chapter seven? There are now only              #
 * 2) ( ( 12 factorial) * (2 to the 12th power) / 4 ) = 479,001,600 * 4,096 / 4 =                 #
 * 3) 490,497,638,400 ways to arrange the cubies of your Cube.                                    #
 * By the way, you should now be able to see a pretty "X" pattern of matching cubies on all   |
 * six sides of your Cube.                                                                    |
 * |TOP| ? |TOP|                                                  |
 * | ? |TOP| ? |                                                  |
 * |TOP| ? |TOP|                                                  |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | ? | L | ? | ? | F | ? | ? | R | ? | ? | K | ? |                          |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | B | ? | B |                                                  |
 * | ? | B | ? |                                                  |
 * | B | ? | B |                                                  |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * |TOP| ? |TOP|                                                  |
 * | ? |TOP| ? |                                                  |
 * |TOP| ? |TOP|                                                  |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | ? | L | ? | ? | F | ? | ? | R | ? | ? | K | ? |                          |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | B | ? | B |                                                  |
 * | ? | B | ? |                                                  |
 * | B | ? | B |                                                  |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * | L | ? | L | F | ? | F | R | ? | R | K | ? | K |                          |
 * | B | ? | B |                                                  |
 * | ? | B | ? |                                                  |
 * | B | ? | B |                                                  |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * | B | ? | B |                                                  |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * DIAGRAM 7-10. X Marks Our Progress                                         |
 * DIAGRAM 7-10. X Marks Our Progress                                         |