I assigned my students to write a game book engine, in the style of "Choose your own adventure." Here are the results.
You can get the files you need here.
UW Madison >> CS department >> Tim's website >> Stories