Defining the Data for our Game World
In order to learn some more about forms, let's create some forms that create the data for our game world. First of all, our game is going to have some objects in it that the player can pick up and use - let's define those objects:
  (setq objects '(whiskey-bottle bucket frog chain))
Ok, now let's dissect this line an see what it means: Since a Lisp interpreter always starts reading things in Code mode and expects a form, the first symbol, setq, must be a command. In this case, the command sets a variable to a value: The variable is objects and the value we are setting it to is a list of four objects. Now, since the list is data (i.e., we don't want the compiler to try and call a function called whiskey-bottle), we need to "flip" the compiler into Data mode when reading the list. The single quote in front of the list is the command that tells the compiler to flip:
Lisp code defining the game objects
<< begin < previous - next > end >>