Last updated April 30, 2019
This is not an Inform7 tutorial (for that, I highly recommend this book by Aaron Reed). Instead, it is a simple collection of code examples that show what students usually try to do with their stories when they first get started writing with Inform – all collected in one place so I don’t have to remember where I saved them 🙂
[Doors and Ladders] The Place is a Room. The description is "You are in a room. There is a closed door to the east, but you are not sure if it will open." The oak door is east of the Place and west of the Other Place. The oak door is a door. The Other Place is a room. The description is "It opened!!!! This is the Other Place room description." The wooden ladder is an open unopenable door. The ladder is above the Other Place and below the Third Place. The Third Place is a room. The description is "You are in the Third Room. There are ugly paintings lining the walls."
[Drinking a deadly potion - works both inside or outside of inventory] The Place is a room. The description is "You find yourself in a place." A potion is here. Instead of drinking the potion: say "You pop the cork and drink the potion with vigor. It tastes sweet, but you feel faint as your vision blurs and you slump to the floor."; end the story saying "You have died."
[End play after placing an item on a table] The player carries dagger and a bagel. The Dirt Path is a room. A table is here. It is fixed in place and a supporter. "You see a table on the path and you wonder how it got there." After putting the dagger on the table, end the story finally saying "Huzzah!"
[Examining an item a second time gives more details] The river is here. It is scenery. The description is "[if we have not examined the river] Oily waves lap the rocks jutting from the gloom below. You want nothing to do with it. [otherwise] You duck below one of the supporting ropes and carefully peer downwards. Nothing but darkness, just as before."