Here's two more small Undum examples, with commented source code. They use slightly more advanced techniques than the previous one.
Monty Hall Paradox
An implementation of the Monty Hall paradox, this example lets the player guess which door holds the best prize in a game show. The correct door is randomized and the story text changes according to the player's choices. The player is asked to give their name before the story begins and the name is later used in the story text.
Combat
A simple randomized combat system. The player character and NPCs are given attributes and combat is resolved by throwing dice. The player has health potions that restore hit points.