Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Submission + - Clang Plays Tetris - Tetris as a C++ Template Metaprogram (mattbierner.com)

mjvzb writes: Ever wish compiling was more fun? Well, I recently implemented Tetris as a C++ template metaprogram (Github). The game is played by recompiling its source, taking player input by compiler flag. The runtime program is only needed to print the game screen to the console and save the game state across compiler runs.

Implementing Tetris in templates is not as horrific as you may imagine, and I've put together a post covering the details. Once you get over the syntax, C++ metaprogramming is just like functional programming.

Slashdot Top Deals

"What the scientists have in their briefcases is terrifying." -- Nikita Khrushchev

Working...