QuixiAI shows a delightfully terse FizzBuzz using tuple pattern matching

QuixiAI · x · 2026-11-03

QuixiAI shared a compact FizzBuzz implementation: a for i in 1..=100 loop that pattern-matches on the tuple (i % 3, i % 5), mapping (0,0), (0,) and (,0) to "FizzBuzz", "Fizz" and "Buzz", with a catch-all printing the number, piped to print. A nice showcase of how far pattern matching can compress branching logic.

Original post →

More from coding & agent

coding & agent channel →