Tetris Printer Algorithm

 Youtube Direkttetris

Michael Birken hat einen Algorithmus entwickelt, mit dem er Bilder mit Tetris pixeln kann: „By rotating, positioning and dropping a predetermined sequence of pieces, the Tetris Printer Algorithm exploits the mechanics of Tetris to generate arbitrary bitmap images“. Großartig!

The algorithm converts pixels from a source image into squares in the Tetris playfield, one row at a time from the bottom up. 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. […]

During construction of a row, all of the squares produced by this method must be supported. In the images above, the generated squares are supported by the floor of the playfield. However, if an arbitrary row contains holes, it may not provide the support necessary for the construction of the row above it. The algorithm solves this problem by constructing a flat platform on top of the row with holes. In the animation below, a platform is built above a row comprising of a single red square. The platform is a temporary structure and inserting the final piece removes it.

Tetris Printer Algorithm (via Interweb3000)