Config File

version 2 by Aaron Reed

  • Home page
  • Beginning
  • Previous

  • Example: * Monkeys - A basic example.

    Run once to generate the external config file. Open it in a text editor, then add the two lines:



    Save the config file and re-run the Inform program. It will output a block of Inform statements. Copy and paste this into your source code (overwriting the existing variable declarations) and recompile a final time to complete initialization. You can now modify the values of the variables within the config file and observe the changes reflected in the game.


        Include Config File by Aaron Reed.

        numOfMonkeys is a number variable. monkeyUtterances is a number variable.

        The Jungle is a room. Some monkeys are here. "You can see [numOfMonkeys in words] monkeys here."

        Instead of attacking monkeys:
            repeat with X running from 1 to monkeyUtterances:
                say "[one of]Ooo[or]Aaa[at random]! ".