Skip to content

Instantly share code, notes, and snippets.

Created May 25, 2022 13:08
What would you like to do?
FizzBuzz of first 100 numbers written using TeX macros. TeX is a very strange programming language, but hey it works...
% Compile with pdftex, not pdflatex
\def\modulo#1#2{(#1-(#1/#2)*#2)} % a mod n = a-(a/n)*n where / is integer division
\ifnum \numexpr\modulo{\X}{15} = 0
\ifnum \numexpr\modulo{\X}{3} = 0
\ifnum \numexpr\modulo{\X}{5} = 0
\advance \X by 1
\unless \ifnum \X>100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment