You can now play ‘Tetris’ in a PDF file

You can now play ‘Tetris’ in a PDF file

1 minute, 30 seconds Read
First version of Tetris playing on Samsung desktop PC

The first version of Tetris visible in the Lenin Museum in Tampere. It’s displayed on a SyncMaster 750s monitor and can be played by visitors using a Key Tronic keyboard. Credit: Wikicommons

There’s a global community dedicated to finding new ways to challenge themselves in Tetris, from speedruning the classic puzzler to technically “beating” it. But the latest feat isn’t a newly discovered hidden glitch or high score—it’s an entirely new way to play the game.

Thomas Rinsma, a security analyst and hobbyist tinkerer, recently figured out how to create a version of Tetris that runs inside a PDF file. According to a personal website post subsequently highlighted by BoingBoing on January 15th, Rinsma tackled the project “just for fun” after learning the potential implementations of PDF’s JavaScript API. The result is a novel version Rinsma calls PDFTRIS.

Screenshot of Tetris played in PDF file
PDFTRIS in action. Credit: Popular Science

“[I] realized there just might be enough I/O possibility there for a game,” he wrote. “I/O” stands for “Input/Output,” and refers to the communication between a computer and its users.

Rinsma explained that it’s already “relatively well-known” that PDFs can support a number of features such as dynamic content scripting when opened in something like Adobe Acrobat/Reader. Some of that same scripting support, however, is also available in both Mozilla Firefox and Google Chromium’s respective PDF readers, PDF.js and PDFium.

[ Related: Is Tetris infinite? Teen world champ reaches fabled ‘rebirth’ ]

It gets a bit complex to the layperson from there, but regardless, the end result is a PDF containing a 10×20 grid of field buttons. These alternate between shaded and empty blocks depending on the JavaScript input, allowing a player to use preprogrammed keyboard instructions to move and shift the tetronimoes—the official te

Read More

Similar Posts