Hello World (Inform 7)
This short Inform 7 program prints a greeting to the console.
Inform 7 is a natural language compiler for playing natural language (text adventure) games. The disadvantage of natural language specifications of formal systems is that they often lead to "guess the word" frustrations on the part of programmers. In this case it is assumed that people who are accustomed to playing guess-the-word when playing games will not be so frustrated when they find it necessary while making games.
We must create at least one room, where the adventurer finds themselves at the start of the game. We use the room description to produce our greeting. Strictly speaking, perhaps we should state Its description is ... but we are allowed to elide that, and enter descriptions for objects as a string following their definition.
<<greeting>>= The Logoi is a room. "You hear a hollow voice say, 'Hello, World'."
 wrapping up
Finally, we implement a small test suite:
<<test suite>>= Test me with "look".
and add the boilerplate project and author information. The complete file should be cut-and-pasted into the Inform 7 IDE. (Todo: find a way to import project source code)
<<hello.inform7>>= "hello" by Dave
This produces the (rather boring) game which starts as follows:
An Interactive Fiction by Dave
Release 1 / Serial number 070131 / Inform 7 build 3P53 (I6/v6.30 lib 6/10N) SD
You hear a hollow voice say, "Hello, World".