I’ve been trawling about looking for old Inform (Z-Machine) games to play, and I came across this rather pleasant example of Inform 7 code.
This produces an actual running game, of a sort:
Will's Study is a room. The desk is here. A hastily handwritten note is on it. Description is "It's from your friend Shakespeare: 'I've gone to lunch. You'll have to write the sonnet.'" Composing is an action applying to nothing. The quill is a thing that is in the study. Understand "write sonnet" as composing. Description of the quill is "Old and cruddy". Instead of composing when the player has no quill, say "You have not got the quill." Instead of composing, say "And... done. 'Heya', says Will, returning. You say, 'Hello, Will!' Says Shakespeare, 'Thank you for the time you've taken! You really are a pal, Sir Francis Bacon.'"
I might have to give this a go myself. Maybe some interactive system documentation…