Tetris

My Algorithm

When I thought about designing an algorithm for rotating the shapes in Tetris I had the following criteria: It should be object orientated, easy to implement and understand and hopefully general.

I came up with a general algorithm (The algorithm probably already exist, but I had fun designing it!). I have described it with a few pictures.

What are you waiting for, look at the pictures NOW! Picture 1 Picture 2