Twelve Days of Christmas
Five genre versions of a 250-year-old cumulative carol.
Pick your version — traditional, web, Java, Python, or math — and sing along, one day at a time.
Pick a Version to Sing
Each version uses the same cumulative structure — each new day adds one gift, and you must recite all previous gifts before the new one. Once you pick a genre the menu locks; hit ↻ Restart to choose again.
Choose a version of the song below to begin!
🎶 All twelve days complete! 🎅
Happy Holidays from TNT!
The Song Has a Programming Secret
The cumulative structure of the Twelve Days carol — enter at day 12, fall through to day 11, then 10, all the way to 1 — is elegantly modeled by a programming language feature most beginners are warned to avoid.
A switch statement with no break after each case
falls through to the next case automatically — executing every case
from the entry point downward. That is precisely the Twelve Days structure:
enter at day 3, execute days 3, 2, and 1 in sequence. The absent
break is not a bug here; it is the architecture.
The TNT Cross Training page for this concept shows the fall-through pattern
side by side in JavaScript, Java, and Python 3 — and explains why Python’s
match/case refuses to cascade at all.