The Rubik's cube is a popular brainteaser for all ages. It challenges you to unscramble colors to make a cube with matching colors on each side. Solving the cube is based on patterns; if you can learn a few algorithms, you will be able to impress your friends by solving any Rubik's cube.

Choose whatever color you want to work with. Imagine you are working with blue throughout this article. Make a blue cross in the center of the top layer. The adjacent colors to each piece of the cross should match the color in the center of that side of the cube; for example, the piece that goes on the blue and red edge of the cross should be blue on the blue side and red on the red side.

When the cross is complete, move the four blue corners into place without disturbing the rest of the cross in order to solve the top layer. You can do this by turning a piece of the cross, moving the corner into place, then returning the piece of the cross to its place. When you have finished this step, the top layer will be completely blue.

When the top layer is completely blue, solve the middle layer of the cube. Turn the bottom layer to make a T on one of the sides of the cube. Hold the cube so that this layer faces front. If the bottom square of the T belongs on the left side of the cube, use the following algorithm to move it into place:

Bottom clockwise, Left clockwise, Bottom counter-clockwise, Left counter-clockwise, Bottom counter-clockwise, Front counter-clockwise, Bottom clockwise, Front clockwise.

If the bottom square of the T belongs on the right side of the cube use this algorithm to move it into place:

Bottom counter-clockwise, Front counter-clockwise, Bottom clockwise, Front clockwise, Bottom clockwise, Left clockwise, Bottom counter-clockwise, Left counter-clockwise.

Turn the cube over. If there is a cross in the center, go to Step 4. If there is an L shape, hold the cube so that the L faces left and perform the following algorithm to make the cross:

Front clockwise, Top clockwise, Right clockwise, Top counter-clockwise, Right counter-clockwise, Front counter-clockwise.

If there is a line in the center, perform the following algorithm to make the cross:

Front clockwise, Right clockwise, Top clockwise, Right counter-clockwise, Top counter-clockwise, Front counter-clockwise.

If there is a dot in the center, perform either algorithm. This will form one of the other two shapes. Perform the proper algorithm to make the cross.

Find two corners on the top of the cube that are in the right place. They do not need to be oriented correctly. For example, if the cross you just made is white, it is acceptable to have the white corner on the green side of the cube and the green corner on the white side of the cube. The important thing is that the corner would be correct if the colors were reversed.

Hold the cube so that the two corners that are correct are on the left side of the cube. If the correct corners are diagonal to one another, hold the cube so that one of the correct corners is on the top left of the cube. Perform the following algorithm:

Left clockwise, Front counter-clockwise, Right counter-clockwise, Top clockwise, Left counter-clockwise, Top counter-clockwise, Right clockwise, Top clockwise, Top clockwise.

Repeat this step if needed until all four corners are in the right place.

Examine the cube. If you have three corners that need to be twisted counter-clockwise, or all four corners are incorrectly oriented, or two diagonal corners need to be oriented correctly, perform the following algorithm:

Right counter-clockwise, Top counter-clockwise, Right clockwise, Top counter-clockwise, Right counter-clockwise, Top clockwise, Top clockwise, Right clockwise, Top clockwise, Top clockwise.

This algorithm applies to all three of the scenarios listed above. If your cube has any orientation pattern other than the three already mentioned, perform this algorithm: Right counter-clockwise, Top clockwise, Right counter-clockwise, Top clockwise, Right clockwise, Top clockwise, Top clockwise, Right counter-clockwise, Top clockwise, Top clockwise.

Repeat these algorithims until all four corners are oriented correctly.

Examine the cube. If there are no mixed-up pieces, you have beat it.

Any mixed up pieces should be on the side of the cube you have been working with. If you have mixed up pieces elsewhere, go back to Step 2.

If you have a piece on the bottom center that belongs on the top center, a piece on the top center that belongs on the right, and a piece on the right that belongs on the bottom center, perform the following algorithm to solve the cube:

Right clockwise, Right clockwise, Top clockwise, Front clockwise, Back counter-clockwise, Right clockwise, Right clockwise, Front counter-clockwise, Back clockwise, Top clockwise, Right clockwise, Right clockwise.

If you have a piece on the top center that belongs on the bottom, a piece on the bottom center that belongs on the right, and a piece on the right that belongs on the top center, perform the following algorithm:

Right clockwise, Right clockwise, Top counter-clockwise, Front clockwise, Back counter-clockwise, Right clockwise, Right clockwise, Front counter-clockwise, Back clockwise, Top counter clockwise, Right clockwise, Right clockwise.

If you have any other pattern, perform either of these algorithms and re-examine the cube. You should now have one of the patterns described in this step. Perform the correct algorithm to beat the cube.