X

Watch This Algorithm Make Art Using Tetris


June 4, 2013 | Andy Cush

A programmer named Michael Birken created “Tetris Printer,” an algorithm that plays through the titular game in order to create an image. And because we’re operating at an extremely sophisticated level of nerdery here, the pictures it generates are classic video game characters: Mario, Samus Aran, Mrs. Pac-Man, and the like. Watch Tetris Printer in action above, and take a look at the full description of the process at Birken’s site to have your mind blown. For example:

To generate an individual square, the algorithm assembles a structure consisting of a rectangular region fully supported by a single square protruding from the bottom. When the rectangular region is completed, its rows are cleared, leaving behind the protruding square. Three examples of the process appear below.

In other words, the program will sometimes have to correctly place rows upon rows of bricks, only to destroy them and leave one single square behind. I know it’s only an algorithm, but it’s tough not to admire Tetris Printer’s patience.