Programmatically-Generated LaTeX Sieve of Eratosthenes
(tl;dr: see PDF here). For a top-secret joke project I am learning to program in LaTeX as if it were a general-purpose language. LaTeX is my favourite way to write scientific papers, but no one should use it for programmatic logic. Along the way I have implemented a Sieve of Eratosthenes, a well-known algorithm for finding prime numbers. The natural typesetting ability of LaTeX allows me to easily generate an intuitive representation of the inner working of the algorithm.
Watch my rapid descent into TeX-induced insanity in my Github repository.
But I thought I could have LaTeX represent the internal state of the algorithm as a colour-coded matrix at each point in its operation. I'm quite pleased with the result (PDF), (source) which I think is an intuitive representation of how this simple algorithm works.
This can all be done in raw TeX, but I'm not a maniac. ↩