Michael Birken lays out, in detail, a method for teaching a computer to draw arbitrary 8-bit images by playing Tetris, strategically deploying blocks of various colors to cause exactly the picture you want to emerge. The method is (as you'd imagine), starkly terrifying in its complexity, but the video speaks for itself.
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. Three examples of the process appear below.
The algorithm can also generate multiple squares with a single structure as shown below.
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 Hacker News)
Scott Edelman writes, “I interviewed George R. R. Martin at a Thai restaurant on Episode 42 of my Eating the Fantastic podcast (MP3), and after I returned home, remembered I’d also interviewed him back in 1993. After digging out the tape, I couldn’t resist incorporating his amusing admission about ‘a fantasy novel I’ve been working […]
Zero-knowledge proofs are one of the most important concepts in cryptography: they’re a way to “validate a computation on private data by allowing a prover to generate a cryptographic proof that asserts to the correctness of the computed output” — in other words, a way to prove that something is true without learning the details.
Retroworks’ $18 decoder rings don’t have much by way of cryptographic robustness (they compare disfavorably to the cipher-wheel wedding rings my wife and I wear!), but they’re not a bad way to introduce the littlies in your life to the idea of habitual secrecy. (via Red Ferret)
The current web development landscape is rife with buzzwords and technology that gets abandoned almost as soon as it’s made. If you’ve never written a line of code before, it can be hard to figure out what’s coming, what’s here to stay, or how to get ahead.This Beginner Web Development Bundle is a great place […]
The Fader Stealth Quadcopter from TRNDlabs packs incredible flight performance into a package small enough to land on your phone screen, and it’s available now in the Boing Boing Store.The Fader’s six-axis gyroscope module gives it perfect balance in the air. This makes the onboard 720p HD camera all the better for shooting amazing flight […]
Although fully autonomous vehicles aren’t yet allowed on public streets, they are poised to dominate the roads in the not-too-distant future. But before that happens, Apple, Google, Uber, and other companies now investing in self-driving tech are going to need talented developers that can account for the dizzying array of factors at play when a […]