I'm looking for simple examples of using TeX as a programming language, not LaTeX, and ideally these examples only use the primitive TeX commands. Why? Because the members of a local computer club take turns talking about offbeat languages, and it will be my turn soon. The audience ranges from programming neophytes to people with a sophisticated understanding of computer science. I'm trying to come up with examples that everyone can understand, and that also demonstrate how TeX "works."
I'm aware of a few examples along these lines, not all of which are as primitive as I would like:
As long as we're making a list, it's worth including things on the fun/crazy end of the spectrum too. I'm aware of:
Finally, are there certain design patterns or paradigms that are particular to TeX (or macro-based languages in general)? Other languages have things like lambdas, or they may be strongly, weakly, dynamically or statically typed. Some languages lean on encapsulation or being object-oriented, and there's a whole universe of design patterns that fall under the umbrella of "object-oriented." TeX seems to be off in its own world.