C Code with Only `#define` Directives: Black Magic Fire Animation

2025-02-20

This article details how the author created a fire animation program using only the `#define` directive in C. This seemingly impossible task was accomplished by cleverly using the text replacement capabilities of macro definitions, token concatenation, and recursive call techniques. The result is a simulation of fire burning and spreading, demonstrating the power of the C preprocessor and its 'Turing completeness'. The article also highlights the potential risks and problems of improper macro use.

Development preprocessor