### algorithms to solve rubik's cube

I typed this up to show as an example of an ALGORITHM. What is below is all based on Dan Brown's youtube videos.

```Notation:
--------
F = Front side of cube (facing you)
U = Upper side
L = Left side
R = Right side
D = Down side

green side = side with green in center
white side = side with white in center
etc...

center piece = piece in center of a side
corner piece = pieces at the corners
edge piece = not center or corner pieces

```
```
Algorithm Notation:
------------------
F = turn front side clockwise by 90 degrees
F' = turn front side counter-clockwise by 90 degrees
U = turn upper side clockwise by 90 degrees
U' = turn upper side counter-clockwise by 90 degrees
2U = turn upper side by 180 degrees
(clockwise or counter-clockwise...it doesn't matter)
R = turn right side clockwise by 90 degrees
(clockwise, as if you were facing it)
R' = turn right side counter-clockwise by 90 degrees
etc...

```
```
1. Solve the green side first

> find a green edge piece and move it to the Down side
> rotate Down side until other color on the edge piece
matches the center piece
> now twist side 180 degrees to get green edge on green side
> if it's all OK, move on to next edge piece
> if edge is in correct spot but flipped, do F' U L' U'

```
```
at this point, after getting all 4 green edge pieces in place,
you should have the green cross on top and all edge pieces
should be correct

```
```
> fix green side corners:
> find a green corner and get it directly under where it should
go (match the other two colors on the corner piece to the
other two side colors)
> with the piece you are working on in the bottom right corner,
do R' D' R D from 1-6 times (keeping the same face forward at all times)
> once that corner is done, solve the other 3

```
```
at this point you should have the green side done and all of
the first layer done (and all edge pieces matching their correct
sides)

```
```
2. Solve the second layer...

> turn green side down, blue side up
> find an edge piece without blue in it (see ** if can't do this)
> twist the top blue side so edge piece matches side color
> with that piece front and center, look for which side (left
or right) matches top color and do one of these:

top matches right side: U R U' R' U' F' U F

top matches left side: U' L' U L U F U' F'

```
```
> repeat for all edge pieces of second layer....

** if you can't find a top edge piece without blue in it, find
one that is an edge piece in the middle layer and make it the
front-right-middle, then do this: U R U' R' U' F' U F

at this point you should have two layers done!

```
```

3. Solve the BLUE CROSS....

> look at top blue layer for one of these cases:
no small L: do F R U R' U' F' to get small L
small L: make it top back left, do F R U R' U' F'

the "L" you are looking for is made up out of three blue pieces,
the center and two edge pieces

```
```
you should now have three in a row.
make the 3-in-a-row go left to right across the top

```
```
and again do F R U R' U' F' to get blue cross

```
```
> try twisting top blue side so two edge pieces line up
with their correct sides

if you can't get two lined up do R U R' U R 2U R'

if you get two lined up, and they are
across from each other, make the lined-up edges
the front and back sides and do R U R' U R 2U R'
(this should make the two lined-up sides adjacent)

if the two lined up are adjacent, make
them the right and back sides and do R U R' U R 2U R'

```
```
should now have blue cross on top and be able to twist
top to get all edge pieces lined up

```
```
4. solve the final 4 corners!!!

> check the corners to see if they are in their correct
locations (even though they may be flipped). You should
either have 0, 1, or all 4 in their correct spots.

```

```
if 0: do U R U' L' U R' U' L with blue cross on top

this should get 1 or more corners correct

if 1: do U R U' L' U R' U' L with blue cross on top and
correct corner as upper right of front face

this should get 4 corners correct, but you may need
to repeat this U R U' L' U R' U' L once

if 4: go to next step...

```

```
> with 4 corners correct (but flipped), pick a side and make
it the front, with a corner to flip in the top right

```
```
NOTE: always keep this front side the same during the next
few steps!!!!

do   R' D' R D  twice and see if that corner is flipped correctly

if no, do R' D' R D twice again

```
```
if yes, turn up face 90 degrees (U) and repeat with next corner (if needed),
always keeping the same front face (even though it looks like you're
messing things up!)

```
```
NOW TWIST THE TOP AND THE CUBE IS SOLVED!!!

```