Possible Duplicate:
Programming Contest Question: Counting Polyominos
There are different types of Tetris shapes. For example in shape like letters T L I Z J O S
.
I'm trying to get an algorithm that can create these blocks. I'm using C++, but pseudocode would be good enough. Any ideas how to solve it or how to describe the problem to search better for it?
Block is the smallest part of a Tetris shape. If you have 4 blocks to create a shape, then there are only 7 possible shapes:
X X X
X XX X X X XX XX
X XX XX XX XXX XX XX
X
Rotations doesn't count. If you have 3 blocks, then you can shape only 2 blocks:
X X
X XX
X
How many shapes exist when you have n
blocks? And how do they look like?