School's project about tetris game algorithm
One file of a list of tetriminos, one new line between each. Each tetriminos blocks must be in contact with at least one another block on one of his sides, in order to be considered valid.
Example :
$ cat -e valid_sample.fillit
...#$
...#$
...#$
...#$
$
....$
....$
....$
####$
$
.###$
...#$
....$
....$
$
....$
..##$
.##.$
....$
$>
The smallest square filled by these tetriminos on the stdout. Each tetriminos is replaced by a letter. Beginning by A.
Example :
$> cat sample.fillit | cat -e
...#$
...#$
...#$
...#$
$
....$
....$
....$
####$
$
.###$
...#$
....$
....$
$
....$
..##$
.##.$
....$
$
....$
.##.$
.##.$
....$
$
....$
....$
##..$
.##.$
$
##..$
.#..$
.#..$
....$
$
....$
###.$
.#..$
....$
$> ./fillit sample.fillit | cat -e
ABBBB.$
ACCCEE$
AFFCEE$
A.FFGG$
HHHDDG$
.HDD.G$
$>
exit, open, close, write, read, malloc, free.
Few minutes
26 tetriminos.