Home » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware » PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Tutorial

PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Tutorial

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware
Filename: PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Tutorial
Read OK:
File size: 2496 bytes
Load address: 0000
Exec address: 0000
File contents
Tutorial
========

This tutorial will teach you the basics of writting adventures for DavidRPG2.
All the example files are stored in this directory: Double-Click them to try
them out.

This file only tells you the basics, but if you look through other example
files and also look at the Tech.CompDef file which contains the commands 
which can be used in DavidRPG2, after you have mastered these examples the
rest should come easily.

To make your own files there are two ways:
1) Create a text file with your program in then Change its type to 'Advnture'
    (Note: no e) by highlighting it in its directory and doing Menu->File 'x'
    ->Settype and tpye in 'Advnture'.
2) Create a file of type 'Advnture' this can be done in edit by pressing menu
    over the !Edit Icon (Form the resources directory) going to 'Create' and
    at the bottom of this sub-menu typing 'Advnture'. You then have a file of
    the right type which you can save then run.
These methods only work if DavidRPG2 has been seen by the filer.
To Run them Double-Click on the file, to Edit them Shift-Double-Click on it.

Exercise1 - The Basic File
--------------------------

This is the basic file and contains all the parts which must be presanbt in
all adventures.
The lines starting with "|" are comments and are ignored by DavidRPG2.

The file has three parts:

1) A Decription:

...
name = Exercise 1
adventure = tutorial file
author = David Spence 1998
version = 0
...

This part of the file is the descripter, each of the four lines must be
presant.  The text after the = is displayed in the Info box on the main 
window's menu.

2) A start room

...
room one start {
name: "Test Room"
text: "Our first room."
}
...

This is the first room, it also where the game will start, hence the "start"
in the first line.  All files must contain at least one room and one of the
rooms must be the start room.

The first line tells DavidRPG2 that we are telling it about a room, that the
label of the room is "one" and that it is the start room.  This line will
be the same for every room except the label has to be different for every
room and there can only be one start room.

The next line is the name of the room. The name of the room is the text
between the quotes.

The next line is the decription of the room. The decription of the room is
the text between the quotes.

The last line signifies the end of the room.

3) The player information

...
player {
name: "Player"
text: "This is where the title screen goes."
}
...

This is where the player data goes, it is similar in content to the above
room block.


Please run the file 'Exercise1' in this directory. To open it Shift-Double-
Click it.

Exercise 2 - Two rooms
----------------------

For this file we add another room:

...
room two {
name: "Test Room 1"
text: "Our second room."
      "The decription can be on more than"
      "one line!"
south: goto(one)
}
...

Notice how the room description is over three lines, you can have as many
lines as you want to describe a room. Also there is a line starting with
'south:', this tells DavidRPG2 what to do to go north, after this can be
what is called code.  In this example is is just one line telling it to goto
the room with the label 'one', ie the first room.  But the code can be much
more complex: see the 'Example1' file and the Tech.CompDef file.

We have also added a corrisponding 'north:' line to our first room:

...
room one start {
name: "Test Room 1"
text: "Our first room."
north: goto(two)
}                   
... 

Example 3 - Objects
-------------------
Now we can add objects.  This is the bare bones of an object block:

...
object bat {
name: "bat"
text: "It is a long baseball bat."
move: yes
}
...

Notice that it is quite similar to the room. The only new thing is the
'move:' line.  This simply dictates whether you can pick up the object it
is always followed by 'yes' or 'no'.

So we can see the object we must edit the first room and add the line

...
objects: bat
...

This is a comma seperated list of the objects in the room, an object can only
be in one place at a time though.

Example 4 - People
------------------
Again people are quite similar to rooms and objects:

...
person man {
name: "man"
text: "A tall man."
}
...

Notice how similar this is to the objects and rooms.  The man has to go
somewhere, lets put him in the second room by adding the line:

...
people: man
...

Example 5 - Talking
-------------------
So far we have not been able to interact with the game much so lets look at
talking:

We can indroduce a talk block into the person block:

...
talk: {
"hello": print("The man says: Hello\n")
}
...

This looks strange but it is quite straight-forward. The "talk: {" and "}" 
show the start and end of the block, they must be on their own lines. The 
middle line has two parts seperated by a colon. The first is a list of 
keywords seperated by spaces in quotes and the second part is the code which
is executed if any of the keywords appear in a "SAY xxx" command by the user.
We have come across code before to move between rooms and it can be used for
many different things, here it is used to print a line of text.  The "\n"
at the end of the text signifies that we want a new line after our text.

Now every time you go in the second room and type 'say hello' you will get a
reply from the man.

Example 6 - Actions
-------------------
Actions allow you to interact at a deeper level with the game. There are
many permutations.

canbe:   - these specify a actions which can be done by an object or the 
           player. It has similar structure to a talk block.
cando:   - these specify a actions which can be done do an object, the playe
           or a person. It has similar structure to a talk block.
actions: - these specify the actions which room let you do. It is similar
           to the talk block.

Different ways of specifying these blocks and how the user types it in
dictate what code is called.  There are 3 types of input:

1) <Verb>

This is when just a verb is typed in, for example 'jump' it results in the
action: code for the current room for this verb to be called and the cando: 
block for the player for this verb to be called. Both will be called if 
presant and if neither is presant the user is told he has made an invalid
input. This is the code added to the first room:

...
actions: {
"jump": print("There is a large thud.\n")
}
...

2) <Verb> <Object|person>

This is when an object has an action done to it. For this type to work you 
must have an object which has <verb> in its cando list or the player must have <verb> in its cando list. There must also be <Object|Person> in the room.
Code called: a)Current room's action: if it has <verb>
             b)Object of player's cando: if it has <verb>
             c)Player's cando: if it has <verb>
             d)<Object|person>'s canbe: if it has <verb>

3) Use <object> to <verb> <Object|person>
or <Verb> <Object|person> with\using <Object>

This is similar to 2) except that you have to have <object> and its cando:
code is called, if it has <verb>, instead of a, b and c.


2 and 3) 
It is important t note that is the object or person is specified in the user
command then it does not matter if the cando:/canbe: blocks have the verb the
actions the command is still executed.

To test 2 and this I will add the following code to the bat:

...
cando: {
"hit": print("You swing the bat.\n")
}
...

And this to the man:

...
canbe: {
"hit": print("The man topples over.")
}
...

Try hitting the man with and without the bat.

Example1 - Misc
---------------
Most of the rest of the language can be gained from the Language file in this
directory, so please read it. Also the Example1 file contains a slightly 
larger example which you may want to look at. Here is a summary of the rest
of the language:

a) energy:/dead:
energy: is followed by a value which is the energy of the object, person or
player.  If the energy ever passes through or to zero from a positive value 
the dead: code is called. The energy can be changed in code, see later.
It is use in Example1 for the box (hit the box twice with the bat.)

b) variables
Variables are used to store whole numbers they are defined in the file with a
start value, see the Example1 file. They can be changed and tested by code.
A Definition looks like this:

variable x = 9

c) code
There has been a lot of talk of code, as well as the single instructions
used in the above examples there are also multi-line code blocks which start
with a { then a return and end with a } on its own line. In between can be
the following commands:

  print(string/variable)     - output
 
  goto(label)                - goto room

  P_move(<person>,<room>)    - Moves a person to a room. 

  O_move(<object>,<room>)    - Moves a object to a room 

  end()                      - Ends the game

  change(<variable>,<int>)   - changes <variable>/energy by <int>

  set(<variable>,<int>)      - set <variable>/energy to <int>

  if(<variable>,<condition>) - see language

There is a more detaled description in the language file.

d) see:/unsee:
This specifies code which will be called when a person sees you or unsees
you.

e) leave:/enter:
Code in a room to be called when you enter or leave.

f) Room null
There is a room called 'null' which objects canbe sent to to make them
disapear.
00000000  54 75 74 6f 72 69 61 6c  0a 3d 3d 3d 3d 3d 3d 3d  |Tutorial.=======|
00000010  3d 0a 0a 54 68 69 73 20  74 75 74 6f 72 69 61 6c  |=..This tutorial|
00000020  20 77 69 6c 6c 20 74 65  61 63 68 20 79 6f 75 20  | will teach you |
00000030  74 68 65 20 62 61 73 69  63 73 20 6f 66 20 77 72  |the basics of wr|
00000040  69 74 74 69 6e 67 20 61  64 76 65 6e 74 75 72 65  |itting adventure|
00000050  73 20 66 6f 72 20 44 61  76 69 64 52 50 47 32 2e  |s for DavidRPG2.|
00000060  0a 41 6c 6c 20 74 68 65  20 65 78 61 6d 70 6c 65  |.All the example|
00000070  20 66 69 6c 65 73 20 61  72 65 20 73 74 6f 72 65  | files are store|
00000080  64 20 69 6e 20 74 68 69  73 20 64 69 72 65 63 74  |d in this direct|
00000090  6f 72 79 3a 20 44 6f 75  62 6c 65 2d 43 6c 69 63  |ory: Double-Clic|
000000a0  6b 20 74 68 65 6d 20 74  6f 20 74 72 79 0a 74 68  |k them to try.th|
000000b0  65 6d 20 6f 75 74 2e 0a  0a 54 68 69 73 20 66 69  |em out...This fi|
000000c0  6c 65 20 6f 6e 6c 79 20  74 65 6c 6c 73 20 79 6f  |le only tells yo|
000000d0  75 20 74 68 65 20 62 61  73 69 63 73 2c 20 62 75  |u the basics, bu|
000000e0  74 20 69 66 20 79 6f 75  20 6c 6f 6f 6b 20 74 68  |t if you look th|
000000f0  72 6f 75 67 68 20 6f 74  68 65 72 20 65 78 61 6d  |rough other exam|
00000100  70 6c 65 0a 66 69 6c 65  73 20 61 6e 64 20 61 6c  |ple.files and al|
00000110  73 6f 20 6c 6f 6f 6b 20  61 74 20 74 68 65 20 54  |so look at the T|
00000120  65 63 68 2e 43 6f 6d 70  44 65 66 20 66 69 6c 65  |ech.CompDef file|
00000130  20 77 68 69 63 68 20 63  6f 6e 74 61 69 6e 73 20  | which contains |
00000140  74 68 65 20 63 6f 6d 6d  61 6e 64 73 20 0a 77 68  |the commands .wh|
00000150  69 63 68 20 63 61 6e 20  62 65 20 75 73 65 64 20  |ich can be used |
00000160  69 6e 20 44 61 76 69 64  52 50 47 32 2c 20 61 66  |in DavidRPG2, af|
00000170  74 65 72 20 79 6f 75 20  68 61 76 65 20 6d 61 73  |ter you have mas|
00000180  74 65 72 65 64 20 74 68  65 73 65 20 65 78 61 6d  |tered these exam|
00000190  70 6c 65 73 20 74 68 65  0a 72 65 73 74 20 73 68  |ples the.rest sh|
000001a0  6f 75 6c 64 20 63 6f 6d  65 20 65 61 73 69 6c 79  |ould come easily|
000001b0  2e 0a 0a 54 6f 20 6d 61  6b 65 20 79 6f 75 72 20  |...To make your |
000001c0  6f 77 6e 20 66 69 6c 65  73 20 74 68 65 72 65 20  |own files there |
000001d0  61 72 65 20 74 77 6f 20  77 61 79 73 3a 0a 31 29  |are two ways:.1)|
000001e0  20 43 72 65 61 74 65 20  61 20 74 65 78 74 20 66  | Create a text f|
000001f0  69 6c 65 20 77 69 74 68  20 79 6f 75 72 20 70 72  |ile with your pr|
00000200  6f 67 72 61 6d 20 69 6e  20 74 68 65 6e 20 43 68  |ogram in then Ch|
00000210  61 6e 67 65 20 69 74 73  20 74 79 70 65 20 74 6f  |ange its type to|
00000220  20 27 41 64 76 6e 74 75  72 65 27 0a 20 20 20 20  | 'Advnture'.    |
00000230  28 4e 6f 74 65 3a 20 6e  6f 20 65 29 20 62 79 20  |(Note: no e) by |
00000240  68 69 67 68 6c 69 67 68  74 69 6e 67 20 69 74 20  |highlighting it |
00000250  69 6e 20 69 74 73 20 64  69 72 65 63 74 6f 72 79  |in its directory|
00000260  20 61 6e 64 20 64 6f 69  6e 67 20 4d 65 6e 75 2d  | and doing Menu-|
00000270  3e 46 69 6c 65 20 27 78  27 0a 20 20 20 20 2d 3e  |>File 'x'.    ->|
00000280  53 65 74 74 79 70 65 20  61 6e 64 20 74 70 79 65  |Settype and tpye|
00000290  20 69 6e 20 27 41 64 76  6e 74 75 72 65 27 2e 0a  | in 'Advnture'..|
000002a0  32 29 20 43 72 65 61 74  65 20 61 20 66 69 6c 65  |2) Create a file|
000002b0  20 6f 66 20 74 79 70 65  20 27 41 64 76 6e 74 75  | of type 'Advntu|
000002c0  72 65 27 20 74 68 69 73  20 63 61 6e 20 62 65 20  |re' this can be |
000002d0  64 6f 6e 65 20 69 6e 20  65 64 69 74 20 62 79 20  |done in edit by |
000002e0  70 72 65 73 73 69 6e 67  20 6d 65 6e 75 0a 20 20  |pressing menu.  |
000002f0  20 20 6f 76 65 72 20 74  68 65 20 21 45 64 69 74  |  over the !Edit|
00000300  20 49 63 6f 6e 20 28 46  6f 72 6d 20 74 68 65 20  | Icon (Form the |
00000310  72 65 73 6f 75 72 63 65  73 20 64 69 72 65 63 74  |resources direct|
00000320  6f 72 79 29 20 67 6f 69  6e 67 20 74 6f 20 27 43  |ory) going to 'C|
00000330  72 65 61 74 65 27 20 61  6e 64 0a 20 20 20 20 61  |reate' and.    a|
00000340  74 20 74 68 65 20 62 6f  74 74 6f 6d 20 6f 66 20  |t the bottom of |
00000350  74 68 69 73 20 73 75 62  2d 6d 65 6e 75 20 74 79  |this sub-menu ty|
00000360  70 69 6e 67 20 27 41 64  76 6e 74 75 72 65 27 2e  |ping 'Advnture'.|
00000370  20 59 6f 75 20 74 68 65  6e 20 68 61 76 65 20 61  | You then have a|
00000380  20 66 69 6c 65 20 6f 66  0a 20 20 20 20 74 68 65  | file of.    the|
00000390  20 72 69 67 68 74 20 74  79 70 65 20 77 68 69 63  | right type whic|
000003a0  68 20 79 6f 75 20 63 61  6e 20 73 61 76 65 20 74  |h you can save t|
000003b0  68 65 6e 20 72 75 6e 2e  0a 54 68 65 73 65 20 6d  |hen run..These m|
000003c0  65 74 68 6f 64 73 20 6f  6e 6c 79 20 77 6f 72 6b  |ethods only work|
000003d0  20 69 66 20 44 61 76 69  64 52 50 47 32 20 68 61  | if DavidRPG2 ha|
000003e0  73 20 62 65 65 6e 20 73  65 65 6e 20 62 79 20 74  |s been seen by t|
000003f0  68 65 20 66 69 6c 65 72  2e 0a 54 6f 20 52 75 6e  |he filer..To Run|
00000400  20 74 68 65 6d 20 44 6f  75 62 6c 65 2d 43 6c 69  | them Double-Cli|
00000410  63 6b 20 6f 6e 20 74 68  65 20 66 69 6c 65 2c 20  |ck on the file, |
00000420  74 6f 20 45 64 69 74 20  74 68 65 6d 20 53 68 69  |to Edit them Shi|
00000430  66 74 2d 44 6f 75 62 6c  65 2d 43 6c 69 63 6b 20  |ft-Double-Click |
00000440  6f 6e 20 69 74 2e 0a 0a  45 78 65 72 63 69 73 65  |on it...Exercise|
00000450  31 20 2d 20 54 68 65 20  42 61 73 69 63 20 46 69  |1 - The Basic Fi|
00000460  6c 65 0a 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |le.-------------|
00000470  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0a 0a 54  |-------------..T|
00000480  68 69 73 20 69 73 20 74  68 65 20 62 61 73 69 63  |his is the basic|
00000490  20 66 69 6c 65 20 61 6e  64 20 63 6f 6e 74 61 69  | file and contai|
000004a0  6e 73 20 61 6c 6c 20 74  68 65 20 70 61 72 74 73  |ns all the parts|
000004b0  20 77 68 69 63 68 20 6d  75 73 74 20 62 65 20 70  | which must be p|
000004c0  72 65 73 61 6e 62 74 20  69 6e 0a 61 6c 6c 20 61  |resanbt in.all a|
000004d0  64 76 65 6e 74 75 72 65  73 2e 0a 54 68 65 20 6c  |dventures..The l|
000004e0  69 6e 65 73 20 73 74 61  72 74 69 6e 67 20 77 69  |ines starting wi|
000004f0  74 68 20 22 7c 22 20 61  72 65 20 63 6f 6d 6d 65  |th "|" are comme|
00000500  6e 74 73 20 61 6e 64 20  61 72 65 20 69 67 6e 6f  |nts and are igno|
00000510  72 65 64 20 62 79 20 44  61 76 69 64 52 50 47 32  |red by DavidRPG2|
00000520  2e 0a 0a 54 68 65 20 66  69 6c 65 20 68 61 73 20  |...The file has |
00000530  74 68 72 65 65 20 70 61  72 74 73 3a 0a 0a 31 29  |three parts:..1)|
00000540  20 41 20 44 65 63 72 69  70 74 69 6f 6e 3a 0a 0a  | A Decription:..|
00000550  2e 2e 2e 0a 6e 61 6d 65  20 3d 20 45 78 65 72 63  |....name = Exerc|
00000560  69 73 65 20 31 0a 61 64  76 65 6e 74 75 72 65 20  |ise 1.adventure |
00000570  3d 20 74 75 74 6f 72 69  61 6c 20 66 69 6c 65 0a  |= tutorial file.|
00000580  61 75 74 68 6f 72 20 3d  20 44 61 76 69 64 20 53  |author = David S|
00000590  70 65 6e 63 65 20 31 39  39 38 0a 76 65 72 73 69  |pence 1998.versi|
000005a0  6f 6e 20 3d 20 30 0a 2e  2e 2e 0a 0a 54 68 69 73  |on = 0......This|
000005b0  20 70 61 72 74 20 6f 66  20 74 68 65 20 66 69 6c  | part of the fil|
000005c0  65 20 69 73 20 74 68 65  20 64 65 73 63 72 69 70  |e is the descrip|
000005d0  74 65 72 2c 20 65 61 63  68 20 6f 66 20 74 68 65  |ter, each of the|
000005e0  20 66 6f 75 72 20 6c 69  6e 65 73 20 6d 75 73 74  | four lines must|
000005f0  20 62 65 0a 70 72 65 73  61 6e 74 2e 20 20 54 68  | be.presant.  Th|
00000600  65 20 74 65 78 74 20 61  66 74 65 72 20 74 68 65  |e text after the|
00000610  20 3d 20 69 73 20 64 69  73 70 6c 61 79 65 64 20  | = is displayed |
00000620  69 6e 20 74 68 65 20 49  6e 66 6f 20 62 6f 78 20  |in the Info box |
00000630  6f 6e 20 74 68 65 20 6d  61 69 6e 20 0a 77 69 6e  |on the main .win|
00000640  64 6f 77 27 73 20 6d 65  6e 75 2e 0a 0a 32 29 20  |dow's menu...2) |
00000650  41 20 73 74 61 72 74 20  72 6f 6f 6d 0a 0a 2e 2e  |A start room....|
00000660  2e 0a 72 6f 6f 6d 20 6f  6e 65 20 73 74 61 72 74  |..room one start|
00000670  20 7b 0a 6e 61 6d 65 3a  20 22 54 65 73 74 20 52  | {.name: "Test R|
00000680  6f 6f 6d 22 0a 74 65 78  74 3a 20 22 4f 75 72 20  |oom".text: "Our |
00000690  66 69 72 73 74 20 72 6f  6f 6d 2e 22 0a 7d 0a 2e  |first room.".}..|
000006a0  2e 2e 0a 0a 54 68 69 73  20 69 73 20 74 68 65 20  |....This is the |
000006b0  66 69 72 73 74 20 72 6f  6f 6d 2c 20 69 74 20 61  |first room, it a|
000006c0  6c 73 6f 20 77 68 65 72  65 20 74 68 65 20 67 61  |lso where the ga|
000006d0  6d 65 20 77 69 6c 6c 20  73 74 61 72 74 2c 20 68  |me will start, h|
000006e0  65 6e 63 65 20 74 68 65  20 22 73 74 61 72 74 22  |ence the "start"|
000006f0  0a 69 6e 20 74 68 65 20  66 69 72 73 74 20 6c 69  |.in the first li|
00000700  6e 65 2e 20 20 41 6c 6c  20 66 69 6c 65 73 20 6d  |ne.  All files m|
00000710  75 73 74 20 63 6f 6e 74  61 69 6e 20 61 74 20 6c  |ust contain at l|
00000720  65 61 73 74 20 6f 6e 65  20 72 6f 6f 6d 20 61 6e  |east one room an|
00000730  64 20 6f 6e 65 20 6f 66  20 74 68 65 0a 72 6f 6f  |d one of the.roo|
00000740  6d 73 20 6d 75 73 74 20  62 65 20 74 68 65 20 73  |ms must be the s|
00000750  74 61 72 74 20 72 6f 6f  6d 2e 0a 0a 54 68 65 20  |tart room...The |
00000760  66 69 72 73 74 20 6c 69  6e 65 20 74 65 6c 6c 73  |first line tells|
00000770  20 44 61 76 69 64 52 50  47 32 20 74 68 61 74 20  | DavidRPG2 that |
00000780  77 65 20 61 72 65 20 74  65 6c 6c 69 6e 67 20 69  |we are telling i|
00000790  74 20 61 62 6f 75 74 20  61 20 72 6f 6f 6d 2c 20  |t about a room, |
000007a0  74 68 61 74 20 74 68 65  0a 6c 61 62 65 6c 20 6f  |that the.label o|
000007b0  66 20 74 68 65 20 72 6f  6f 6d 20 69 73 20 22 6f  |f the room is "o|
000007c0  6e 65 22 20 61 6e 64 20  74 68 61 74 20 69 74 20  |ne" and that it |
000007d0  69 73 20 74 68 65 20 73  74 61 72 74 20 72 6f 6f  |is the start roo|
000007e0  6d 2e 20 20 54 68 69 73  20 6c 69 6e 65 20 77 69  |m.  This line wi|
000007f0  6c 6c 0a 62 65 20 74 68  65 20 73 61 6d 65 20 66  |ll.be the same f|
00000800  6f 72 20 65 76 65 72 79  20 72 6f 6f 6d 20 65 78  |or every room ex|
00000810  63 65 70 74 20 74 68 65  20 6c 61 62 65 6c 20 68  |cept the label h|
00000820  61 73 20 74 6f 20 62 65  20 64 69 66 66 65 72 65  |as to be differe|
00000830  6e 74 20 66 6f 72 20 65  76 65 72 79 0a 72 6f 6f  |nt for every.roo|
00000840  6d 20 61 6e 64 20 74 68  65 72 65 20 63 61 6e 20  |m and there can |
00000850  6f 6e 6c 79 20 62 65 20  6f 6e 65 20 73 74 61 72  |only be one star|
00000860  74 20 72 6f 6f 6d 2e 0a  0a 54 68 65 20 6e 65 78  |t room...The nex|
00000870  74 20 6c 69 6e 65 20 69  73 20 74 68 65 20 6e 61  |t line is the na|
00000880  6d 65 20 6f 66 20 74 68  65 20 72 6f 6f 6d 2e 20  |me of the room. |
00000890  54 68 65 20 6e 61 6d 65  20 6f 66 20 74 68 65 20  |The name of the |
000008a0  72 6f 6f 6d 20 69 73 20  74 68 65 20 74 65 78 74  |room is the text|
000008b0  0a 62 65 74 77 65 65 6e  20 74 68 65 20 71 75 6f  |.between the quo|
000008c0  74 65 73 2e 0a 0a 54 68  65 20 6e 65 78 74 20 6c  |tes...The next l|
000008d0  69 6e 65 20 69 73 20 74  68 65 20 64 65 63 72 69  |ine is the decri|
000008e0  70 74 69 6f 6e 20 6f 66  20 74 68 65 20 72 6f 6f  |ption of the roo|
000008f0  6d 2e 20 54 68 65 20 64  65 63 72 69 70 74 69 6f  |m. The decriptio|
00000900  6e 20 6f 66 20 74 68 65  20 72 6f 6f 6d 20 69 73  |n of the room is|
00000910  0a 74 68 65 20 74 65 78  74 20 62 65 74 77 65 65  |.the text betwee|
00000920  6e 20 74 68 65 20 71 75  6f 74 65 73 2e 0a 0a 54  |n the quotes...T|
00000930  68 65 20 6c 61 73 74 20  6c 69 6e 65 20 73 69 67  |he last line sig|
00000940  6e 69 66 69 65 73 20 74  68 65 20 65 6e 64 20 6f  |nifies the end o|
00000950  66 20 74 68 65 20 72 6f  6f 6d 2e 0a 0a 33 29 20  |f the room...3) |
00000960  54 68 65 20 70 6c 61 79  65 72 20 69 6e 66 6f 72  |The player infor|
00000970  6d 61 74 69 6f 6e 0a 0a  2e 2e 2e 0a 70 6c 61 79  |mation......play|
00000980  65 72 20 7b 0a 6e 61 6d  65 3a 20 22 50 6c 61 79  |er {.name: "Play|
00000990  65 72 22 0a 74 65 78 74  3a 20 22 54 68 69 73 20  |er".text: "This |
000009a0  69 73 20 77 68 65 72 65  20 74 68 65 20 74 69 74  |is where the tit|
000009b0  6c 65 20 73 63 72 65 65  6e 20 67 6f 65 73 2e 22  |le screen goes."|
000009c0  0a 7d 0a 2e 2e 2e 0a 0a  54 68 69 73 20 69 73 20  |.}......This is |
000009d0  77 68 65 72 65 20 74 68  65 20 70 6c 61 79 65 72  |where the player|
000009e0  20 64 61 74 61 20 67 6f  65 73 2c 20 69 74 20 69  | data goes, it i|
000009f0  73 20 73 69 6d 69 6c 61  72 20 69 6e 20 63 6f 6e  |s similar in con|
00000a00  74 65 6e 74 20 74 6f 20  74 68 65 20 61 62 6f 76  |tent to the abov|
00000a10  65 0a 72 6f 6f 6d 20 62  6c 6f 63 6b 2e 0a 0a 0a  |e.room block....|
00000a20  50 6c 65 61 73 65 20 72  75 6e 20 74 68 65 20 66  |Please run the f|
00000a30  69 6c 65 20 27 45 78 65  72 63 69 73 65 31 27 20  |ile 'Exercise1' |
00000a40  69 6e 20 74 68 69 73 20  64 69 72 65 63 74 6f 72  |in this director|
00000a50  79 2e 20 54 6f 20 6f 70  65 6e 20 69 74 20 53 68  |y. To open it Sh|
00000a60  69 66 74 2d 44 6f 75 62  6c 65 2d 0a 43 6c 69 63  |ift-Double-.Clic|
00000a70  6b 20 69 74 2e 0a 0a 45  78 65 72 63 69 73 65 20  |k it...Exercise |
00000a80  32 20 2d 20 54 77 6f 20  72 6f 6f 6d 73 0a 2d 2d  |2 - Two rooms.--|
00000a90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000aa0  2d 2d 2d 2d 0a 0a 46 6f  72 20 74 68 69 73 20 66  |----..For this f|
00000ab0  69 6c 65 20 77 65 20 61  64 64 20 61 6e 6f 74 68  |ile we add anoth|
00000ac0  65 72 20 72 6f 6f 6d 3a  0a 0a 2e 2e 2e 0a 72 6f  |er room:......ro|
00000ad0  6f 6d 20 74 77 6f 20 7b  0a 6e 61 6d 65 3a 20 22  |om two {.name: "|
00000ae0  54 65 73 74 20 52 6f 6f  6d 20 31 22 0a 74 65 78  |Test Room 1".tex|
00000af0  74 3a 20 22 4f 75 72 20  73 65 63 6f 6e 64 20 72  |t: "Our second r|
00000b00  6f 6f 6d 2e 22 0a 20 20  20 20 20 20 22 54 68 65  |oom.".      "The|
00000b10  20 64 65 63 72 69 70 74  69 6f 6e 20 63 61 6e 20  | decription can |
00000b20  62 65 20 6f 6e 20 6d 6f  72 65 20 74 68 61 6e 22  |be on more than"|
00000b30  0a 20 20 20 20 20 20 22  6f 6e 65 20 6c 69 6e 65  |.      "one line|
00000b40  21 22 0a 73 6f 75 74 68  3a 20 67 6f 74 6f 28 6f  |!".south: goto(o|
00000b50  6e 65 29 0a 7d 0a 2e 2e  2e 0a 0a 4e 6f 74 69 63  |ne).}......Notic|
00000b60  65 20 68 6f 77 20 74 68  65 20 72 6f 6f 6d 20 64  |e how the room d|
00000b70  65 73 63 72 69 70 74 69  6f 6e 20 69 73 20 6f 76  |escription is ov|
00000b80  65 72 20 74 68 72 65 65  20 6c 69 6e 65 73 2c 20  |er three lines, |
00000b90  79 6f 75 20 63 61 6e 20  68 61 76 65 20 61 73 20  |you can have as |
00000ba0  6d 61 6e 79 0a 6c 69 6e  65 73 20 61 73 20 79 6f  |many.lines as yo|
00000bb0  75 20 77 61 6e 74 20 74  6f 20 64 65 73 63 72 69  |u want to descri|
00000bc0  62 65 20 61 20 72 6f 6f  6d 2e 20 41 6c 73 6f 20  |be a room. Also |
00000bd0  74 68 65 72 65 20 69 73  20 61 20 6c 69 6e 65 20  |there is a line |
00000be0  73 74 61 72 74 69 6e 67  20 77 69 74 68 0a 27 73  |starting with.'s|
00000bf0  6f 75 74 68 3a 27 2c 20  74 68 69 73 20 74 65 6c  |outh:', this tel|
00000c00  6c 73 20 44 61 76 69 64  52 50 47 32 20 77 68 61  |ls DavidRPG2 wha|
00000c10  74 20 74 6f 20 64 6f 20  74 6f 20 67 6f 20 6e 6f  |t to do to go no|
00000c20  72 74 68 2c 20 61 66 74  65 72 20 74 68 69 73 20  |rth, after this |
00000c30  63 61 6e 20 62 65 0a 77  68 61 74 20 69 73 20 63  |can be.what is c|
00000c40  61 6c 6c 65 64 20 63 6f  64 65 2e 20 20 49 6e 20  |alled code.  In |
00000c50  74 68 69 73 20 65 78 61  6d 70 6c 65 20 69 73 20  |this example is |
00000c60  69 73 20 6a 75 73 74 20  6f 6e 65 20 6c 69 6e 65  |is just one line|
00000c70  20 74 65 6c 6c 69 6e 67  20 69 74 20 74 6f 20 67  | telling it to g|
00000c80  6f 74 6f 0a 74 68 65 20  72 6f 6f 6d 20 77 69 74  |oto.the room wit|
00000c90  68 20 74 68 65 20 6c 61  62 65 6c 20 27 6f 6e 65  |h the label 'one|
00000ca0  27 2c 20 69 65 20 74 68  65 20 66 69 72 73 74 20  |', ie the first |
00000cb0  72 6f 6f 6d 2e 20 20 42  75 74 20 74 68 65 20 63  |room.  But the c|
00000cc0  6f 64 65 20 63 61 6e 20  62 65 20 6d 75 63 68 0a  |ode can be much.|
00000cd0  6d 6f 72 65 20 63 6f 6d  70 6c 65 78 3a 20 73 65  |more complex: se|
00000ce0  65 20 74 68 65 20 27 45  78 61 6d 70 6c 65 31 27  |e the 'Example1'|
00000cf0  20 66 69 6c 65 20 61 6e  64 20 74 68 65 20 54 65  | file and the Te|
00000d00  63 68 2e 43 6f 6d 70 44  65 66 20 66 69 6c 65 2e  |ch.CompDef file.|
00000d10  0a 0a 57 65 20 68 61 76  65 20 61 6c 73 6f 20 61  |..We have also a|
00000d20  64 64 65 64 20 61 20 63  6f 72 72 69 73 70 6f 6e  |dded a corrispon|
00000d30  64 69 6e 67 20 27 6e 6f  72 74 68 3a 27 20 6c 69  |ding 'north:' li|
00000d40  6e 65 20 74 6f 20 6f 75  72 20 66 69 72 73 74 20  |ne to our first |
00000d50  72 6f 6f 6d 3a 0a 0a 2e  2e 2e 0a 72 6f 6f 6d 20  |room:......room |
00000d60  6f 6e 65 20 73 74 61 72  74 20 7b 0a 6e 61 6d 65  |one start {.name|
00000d70  3a 20 22 54 65 73 74 20  52 6f 6f 6d 20 31 22 0a  |: "Test Room 1".|
00000d80  74 65 78 74 3a 20 22 4f  75 72 20 66 69 72 73 74  |text: "Our first|
00000d90  20 72 6f 6f 6d 2e 22 0a  6e 6f 72 74 68 3a 20 67  | room.".north: g|
00000da0  6f 74 6f 28 74 77 6f 29  0a 7d 20 20 20 20 20 20  |oto(two).}      |
00000db0  20 20 20 20 20 20 20 20  20 20 20 20 20 0a 2e 2e  |             ...|
00000dc0  2e 20 0a 0a 45 78 61 6d  70 6c 65 20 33 20 2d 20  |. ..Example 3 - |
00000dd0  4f 62 6a 65 63 74 73 0a  2d 2d 2d 2d 2d 2d 2d 2d  |Objects.--------|
00000de0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0a 4e 6f 77 20  |-----------.Now |
00000df0  77 65 20 63 61 6e 20 61  64 64 20 6f 62 6a 65 63  |we can add objec|
00000e00  74 73 2e 20 20 54 68 69  73 20 69 73 20 74 68 65  |ts.  This is the|
00000e10  20 62 61 72 65 20 62 6f  6e 65 73 20 6f 66 20 61  | bare bones of a|
00000e20  6e 20 6f 62 6a 65 63 74  20 62 6c 6f 63 6b 3a 0a  |n object block:.|
00000e30  0a 2e 2e 2e 0a 6f 62 6a  65 63 74 20 62 61 74 20  |.....object bat |
00000e40  7b 0a 6e 61 6d 65 3a 20  22 62 61 74 22 0a 74 65  |{.name: "bat".te|
00000e50  78 74 3a 20 22 49 74 20  69 73 20 61 20 6c 6f 6e  |xt: "It is a lon|
00000e60  67 20 62 61 73 65 62 61  6c 6c 20 62 61 74 2e 22  |g baseball bat."|
00000e70  0a 6d 6f 76 65 3a 20 79  65 73 0a 7d 0a 2e 2e 2e  |.move: yes.}....|
00000e80  0a 0a 4e 6f 74 69 63 65  20 74 68 61 74 20 69 74  |..Notice that it|
00000e90  20 69 73 20 71 75 69 74  65 20 73 69 6d 69 6c 61  | is quite simila|
00000ea0  72 20 74 6f 20 74 68 65  20 72 6f 6f 6d 2e 20 54  |r to the room. T|
00000eb0  68 65 20 6f 6e 6c 79 20  6e 65 77 20 74 68 69 6e  |he only new thin|
00000ec0  67 20 69 73 20 74 68 65  0a 27 6d 6f 76 65 3a 27  |g is the.'move:'|
00000ed0  20 6c 69 6e 65 2e 20 20  54 68 69 73 20 73 69 6d  | line.  This sim|
00000ee0  70 6c 79 20 64 69 63 74  61 74 65 73 20 77 68 65  |ply dictates whe|
00000ef0  74 68 65 72 20 79 6f 75  20 63 61 6e 20 70 69 63  |ther you can pic|
00000f00  6b 20 75 70 20 74 68 65  20 6f 62 6a 65 63 74 20  |k up the object |
00000f10  69 74 0a 69 73 20 61 6c  77 61 79 73 20 66 6f 6c  |it.is always fol|
00000f20  6c 6f 77 65 64 20 62 79  20 27 79 65 73 27 20 6f  |lowed by 'yes' o|
00000f30  72 20 27 6e 6f 27 2e 0a  0a 53 6f 20 77 65 20 63  |r 'no'...So we c|
00000f40  61 6e 20 73 65 65 20 74  68 65 20 6f 62 6a 65 63  |an see the objec|
00000f50  74 20 77 65 20 6d 75 73  74 20 65 64 69 74 20 74  |t we must edit t|
00000f60  68 65 20 66 69 72 73 74  20 72 6f 6f 6d 20 61 6e  |he first room an|
00000f70  64 20 61 64 64 20 74 68  65 20 6c 69 6e 65 0a 0a  |d add the line..|
00000f80  2e 2e 2e 0a 6f 62 6a 65  63 74 73 3a 20 62 61 74  |....objects: bat|
00000f90  0a 2e 2e 2e 0a 0a 54 68  69 73 20 69 73 20 61 20  |......This is a |
00000fa0  63 6f 6d 6d 61 20 73 65  70 65 72 61 74 65 64 20  |comma seperated |
00000fb0  6c 69 73 74 20 6f 66 20  74 68 65 20 6f 62 6a 65  |list of the obje|
00000fc0  63 74 73 20 69 6e 20 74  68 65 20 72 6f 6f 6d 2c  |cts in the room,|
00000fd0  20 61 6e 20 6f 62 6a 65  63 74 20 63 61 6e 20 6f  | an object can o|
00000fe0  6e 6c 79 0a 62 65 20 69  6e 20 6f 6e 65 20 70 6c  |nly.be in one pl|
00000ff0  61 63 65 20 61 74 20 61  20 74 69 6d 65 20 74 68  |ace at a time th|
00001000  6f 75 67 68 2e 0a 0a 45  78 61 6d 70 6c 65 20 34  |ough...Example 4|
00001010  20 2d 20 50 65 6f 70 6c  65 0a 2d 2d 2d 2d 2d 2d  | - People.------|
00001020  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0a 41 67 61  |------------.Aga|
00001030  69 6e 20 70 65 6f 70 6c  65 20 61 72 65 20 71 75  |in people are qu|
00001040  69 74 65 20 73 69 6d 69  6c 61 72 20 74 6f 20 72  |ite similar to r|
00001050  6f 6f 6d 73 20 61 6e 64  20 6f 62 6a 65 63 74 73  |ooms and objects|
00001060  3a 0a 0a 2e 2e 2e 0a 70  65 72 73 6f 6e 20 6d 61  |:......person ma|
00001070  6e 20 7b 0a 6e 61 6d 65  3a 20 22 6d 61 6e 22 0a  |n {.name: "man".|
00001080  74 65 78 74 3a 20 22 41  20 74 61 6c 6c 20 6d 61  |text: "A tall ma|
00001090  6e 2e 22 0a 7d 0a 2e 2e  2e 0a 0a 4e 6f 74 69 63  |n.".}......Notic|
000010a0  65 20 68 6f 77 20 73 69  6d 69 6c 61 72 20 74 68  |e how similar th|
000010b0  69 73 20 69 73 20 74 6f  20 74 68 65 20 6f 62 6a  |is is to the obj|
000010c0  65 63 74 73 20 61 6e 64  20 72 6f 6f 6d 73 2e 20  |ects and rooms. |
000010d0  20 54 68 65 20 6d 61 6e  20 68 61 73 20 74 6f 20  | The man has to |
000010e0  67 6f 0a 73 6f 6d 65 77  68 65 72 65 2c 20 6c 65  |go.somewhere, le|
000010f0  74 73 20 70 75 74 20 68  69 6d 20 69 6e 20 74 68  |ts put him in th|
00001100  65 20 73 65 63 6f 6e 64  20 72 6f 6f 6d 20 62 79  |e second room by|
00001110  20 61 64 64 69 6e 67 20  74 68 65 20 6c 69 6e 65  | adding the line|
00001120  3a 0a 0a 2e 2e 2e 0a 70  65 6f 70 6c 65 3a 20 6d  |:......people: m|
00001130  61 6e 0a 2e 2e 2e 0a 0a  45 78 61 6d 70 6c 65 20  |an......Example |
00001140  35 20 2d 20 54 61 6c 6b  69 6e 67 0a 2d 2d 2d 2d  |5 - Talking.----|
00001150  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0a  |---------------.|
00001160  53 6f 20 66 61 72 20 77  65 20 68 61 76 65 20 6e  |So far we have n|
00001170  6f 74 20 62 65 65 6e 20  61 62 6c 65 20 74 6f 20  |ot been able to |
00001180  69 6e 74 65 72 61 63 74  20 77 69 74 68 20 74 68  |interact with th|
00001190  65 20 67 61 6d 65 20 6d  75 63 68 20 73 6f 20 6c  |e game much so l|
000011a0  65 74 73 20 6c 6f 6f 6b  20 61 74 0a 74 61 6c 6b  |ets look at.talk|
000011b0  69 6e 67 3a 0a 0a 57 65  20 63 61 6e 20 69 6e 64  |ing:..We can ind|
000011c0  72 6f 64 75 63 65 20 61  20 74 61 6c 6b 20 62 6c  |roduce a talk bl|
000011d0  6f 63 6b 20 69 6e 74 6f  20 74 68 65 20 70 65 72  |ock into the per|
000011e0  73 6f 6e 20 62 6c 6f 63  6b 3a 0a 0a 2e 2e 2e 0a  |son block:......|
000011f0  74 61 6c 6b 3a 20 7b 0a  22 68 65 6c 6c 6f 22 3a  |talk: {."hello":|
00001200  20 70 72 69 6e 74 28 22  54 68 65 20 6d 61 6e 20  | print("The man |
00001210  73 61 79 73 3a 20 48 65  6c 6c 6f 5c 6e 22 29 0a  |says: Hello\n").|
00001220  7d 0a 2e 2e 2e 0a 0a 54  68 69 73 20 6c 6f 6f 6b  |}......This look|
00001230  73 20 73 74 72 61 6e 67  65 20 62 75 74 20 69 74  |s strange but it|
00001240  20 69 73 20 71 75 69 74  65 20 73 74 72 61 69 67  | is quite straig|
00001250  68 74 2d 66 6f 72 77 61  72 64 2e 20 54 68 65 20  |ht-forward. The |
00001260  22 74 61 6c 6b 3a 20 7b  22 20 61 6e 64 20 22 7d  |"talk: {" and "}|
00001270  22 20 0a 73 68 6f 77 20  74 68 65 20 73 74 61 72  |" .show the star|
00001280  74 20 61 6e 64 20 65 6e  64 20 6f 66 20 74 68 65  |t and end of the|
00001290  20 62 6c 6f 63 6b 2c 20  74 68 65 79 20 6d 75 73  | block, they mus|
000012a0  74 20 62 65 20 6f 6e 20  74 68 65 69 72 20 6f 77  |t be on their ow|
000012b0  6e 20 6c 69 6e 65 73 2e  20 54 68 65 20 0a 6d 69  |n lines. The .mi|
000012c0  64 64 6c 65 20 6c 69 6e  65 20 68 61 73 20 74 77  |ddle line has tw|
000012d0  6f 20 70 61 72 74 73 20  73 65 70 65 72 61 74 65  |o parts seperate|
000012e0  64 20 62 79 20 61 20 63  6f 6c 6f 6e 2e 20 54 68  |d by a colon. Th|
000012f0  65 20 66 69 72 73 74 20  69 73 20 61 20 6c 69 73  |e first is a lis|
00001300  74 20 6f 66 20 0a 6b 65  79 77 6f 72 64 73 20 73  |t of .keywords s|
00001310  65 70 65 72 61 74 65 64  20 62 79 20 73 70 61 63  |eperated by spac|
00001320  65 73 20 69 6e 20 71 75  6f 74 65 73 20 61 6e 64  |es in quotes and|
00001330  20 74 68 65 20 73 65 63  6f 6e 64 20 70 61 72 74  | the second part|
00001340  20 69 73 20 74 68 65 20  63 6f 64 65 20 77 68 69  | is the code whi|
00001350  63 68 0a 69 73 20 65 78  65 63 75 74 65 64 20 69  |ch.is executed i|
00001360  66 20 61 6e 79 20 6f 66  20 74 68 65 20 6b 65 79  |f any of the key|
00001370  77 6f 72 64 73 20 61 70  70 65 61 72 20 69 6e 20  |words appear in |
00001380  61 20 22 53 41 59 20 78  78 78 22 20 63 6f 6d 6d  |a "SAY xxx" comm|
00001390  61 6e 64 20 62 79 20 74  68 65 20 75 73 65 72 2e  |and by the user.|
000013a0  0a 57 65 20 68 61 76 65  20 63 6f 6d 65 20 61 63  |.We have come ac|
000013b0  72 6f 73 73 20 63 6f 64  65 20 62 65 66 6f 72 65  |ross code before|
000013c0  20 74 6f 20 6d 6f 76 65  20 62 65 74 77 65 65 6e  | to move between|
000013d0  20 72 6f 6f 6d 73 20 61  6e 64 20 69 74 20 63 61  | rooms and it ca|
000013e0  6e 20 62 65 20 75 73 65  64 20 66 6f 72 0a 6d 61  |n be used for.ma|
000013f0  6e 79 20 64 69 66 66 65  72 65 6e 74 20 74 68 69  |ny different thi|
00001400  6e 67 73 2c 20 68 65 72  65 20 69 74 20 69 73 20  |ngs, here it is |
00001410  75 73 65 64 20 74 6f 20  70 72 69 6e 74 20 61 20  |used to print a |
00001420  6c 69 6e 65 20 6f 66 20  74 65 78 74 2e 20 20 54  |line of text.  T|
00001430  68 65 20 22 5c 6e 22 0a  61 74 20 74 68 65 20 65  |he "\n".at the e|
00001440  6e 64 20 6f 66 20 74 68  65 20 74 65 78 74 20 73  |nd of the text s|
00001450  69 67 6e 69 66 69 65 73  20 74 68 61 74 20 77 65  |ignifies that we|
00001460  20 77 61 6e 74 20 61 20  6e 65 77 20 6c 69 6e 65  | want a new line|
00001470  20 61 66 74 65 72 20 6f  75 72 20 74 65 78 74 2e  | after our text.|
00001480  0a 0a 4e 6f 77 20 65 76  65 72 79 20 74 69 6d 65  |..Now every time|
00001490  20 79 6f 75 20 67 6f 20  69 6e 20 74 68 65 20 73  | you go in the s|
000014a0  65 63 6f 6e 64 20 72 6f  6f 6d 20 61 6e 64 20 74  |econd room and t|
000014b0  79 70 65 20 27 73 61 79  20 68 65 6c 6c 6f 27 20  |ype 'say hello' |
000014c0  79 6f 75 20 77 69 6c 6c  20 67 65 74 20 61 0a 72  |you will get a.r|
000014d0  65 70 6c 79 20 66 72 6f  6d 20 74 68 65 20 6d 61  |eply from the ma|
000014e0  6e 2e 0a 0a 45 78 61 6d  70 6c 65 20 36 20 2d 20  |n...Example 6 - |
000014f0  41 63 74 69 6f 6e 73 0a  2d 2d 2d 2d 2d 2d 2d 2d  |Actions.--------|
00001500  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0a 41 63 74 69  |-----------.Acti|
00001510  6f 6e 73 20 61 6c 6c 6f  77 20 79 6f 75 20 74 6f  |ons allow you to|
00001520  20 69 6e 74 65 72 61 63  74 20 61 74 20 61 20 64  | interact at a d|
00001530  65 65 70 65 72 20 6c 65  76 65 6c 20 77 69 74 68  |eeper level with|
00001540  20 74 68 65 20 67 61 6d  65 2e 20 54 68 65 72 65  | the game. There|
00001550  20 61 72 65 0a 6d 61 6e  79 20 70 65 72 6d 75 74  | are.many permut|
00001560  61 74 69 6f 6e 73 2e 0a  0a 63 61 6e 62 65 3a 20  |ations...canbe: |
00001570  20 20 2d 20 74 68 65 73  65 20 73 70 65 63 69 66  |  - these specif|
00001580  79 20 61 20 61 63 74 69  6f 6e 73 20 77 68 69 63  |y a actions whic|
00001590  68 20 63 61 6e 20 62 65  20 64 6f 6e 65 20 62 79  |h can be done by|
000015a0  20 61 6e 20 6f 62 6a 65  63 74 20 6f 72 20 74 68  | an object or th|
000015b0  65 20 0a 20 20 20 20 20  20 20 20 20 20 20 70 6c  |e .           pl|
000015c0  61 79 65 72 2e 20 49 74  20 68 61 73 20 73 69 6d  |ayer. It has sim|
000015d0  69 6c 61 72 20 73 74 72  75 63 74 75 72 65 20 74  |ilar structure t|
000015e0  6f 20 61 20 74 61 6c 6b  20 62 6c 6f 63 6b 2e 0a  |o a talk block..|
000015f0  63 61 6e 64 6f 3a 20 20  20 2d 20 74 68 65 73 65  |cando:   - these|
00001600  20 73 70 65 63 69 66 79  20 61 20 61 63 74 69 6f  | specify a actio|
00001610  6e 73 20 77 68 69 63 68  20 63 61 6e 20 62 65 20  |ns which can be |
00001620  64 6f 6e 65 20 64 6f 20  61 6e 20 6f 62 6a 65 63  |done do an objec|
00001630  74 2c 20 74 68 65 20 70  6c 61 79 65 0a 20 20 20  |t, the playe.   |
00001640  20 20 20 20 20 20 20 20  6f 72 20 61 20 70 65 72  |        or a per|
00001650  73 6f 6e 2e 20 49 74 20  68 61 73 20 73 69 6d 69  |son. It has simi|
00001660  6c 61 72 20 73 74 72 75  63 74 75 72 65 20 74 6f  |lar structure to|
00001670  20 61 20 74 61 6c 6b 20  62 6c 6f 63 6b 2e 0a 61  | a talk block..a|
00001680  63 74 69 6f 6e 73 3a 20  2d 20 74 68 65 73 65 20  |ctions: - these |
00001690  73 70 65 63 69 66 79 20  74 68 65 20 61 63 74 69  |specify the acti|
000016a0  6f 6e 73 20 77 68 69 63  68 20 72 6f 6f 6d 20 6c  |ons which room l|
000016b0  65 74 20 79 6f 75 20 64  6f 2e 20 49 74 20 69 73  |et you do. It is|
000016c0  20 73 69 6d 69 6c 61 72  0a 20 20 20 20 20 20 20  | similar.       |
000016d0  20 20 20 20 74 6f 20 74  68 65 20 74 61 6c 6b 20  |    to the talk |
000016e0  62 6c 6f 63 6b 2e 0a 0a  44 69 66 66 65 72 65 6e  |block...Differen|
000016f0  74 20 77 61 79 73 20 6f  66 20 73 70 65 63 69 66  |t ways of specif|
00001700  79 69 6e 67 20 74 68 65  73 65 20 62 6c 6f 63 6b  |ying these block|
00001710  73 20 61 6e 64 20 68 6f  77 20 74 68 65 20 75 73  |s and how the us|
00001720  65 72 20 74 79 70 65 73  20 69 74 20 69 6e 0a 64  |er types it in.d|
00001730  69 63 74 61 74 65 20 77  68 61 74 20 63 6f 64 65  |ictate what code|
00001740  20 69 73 20 63 61 6c 6c  65 64 2e 20 20 54 68 65  | is called.  The|
00001750  72 65 20 61 72 65 20 33  20 74 79 70 65 73 20 6f  |re are 3 types o|
00001760  66 20 69 6e 70 75 74 3a  0a 0a 31 29 20 3c 56 65  |f input:..1) <Ve|
00001770  72 62 3e 0a 0a 54 68 69  73 20 69 73 20 77 68 65  |rb>..This is whe|
00001780  6e 20 6a 75 73 74 20 61  20 76 65 72 62 20 69 73  |n just a verb is|
00001790  20 74 79 70 65 64 20 69  6e 2c 20 66 6f 72 20 65  | typed in, for e|
000017a0  78 61 6d 70 6c 65 20 27  6a 75 6d 70 27 20 69 74  |xample 'jump' it|
000017b0  20 72 65 73 75 6c 74 73  20 69 6e 20 74 68 65 0a  | results in the.|
000017c0  61 63 74 69 6f 6e 3a 20  63 6f 64 65 20 66 6f 72  |action: code for|
000017d0  20 74 68 65 20 63 75 72  72 65 6e 74 20 72 6f 6f  | the current roo|
000017e0  6d 20 66 6f 72 20 74 68  69 73 20 76 65 72 62 20  |m for this verb |
000017f0  74 6f 20 62 65 20 63 61  6c 6c 65 64 20 61 6e 64  |to be called and|
00001800  20 74 68 65 20 63 61 6e  64 6f 3a 20 0a 62 6c 6f  | the cando: .blo|
00001810  63 6b 20 66 6f 72 20 74  68 65 20 70 6c 61 79 65  |ck for the playe|
00001820  72 20 66 6f 72 20 74 68  69 73 20 76 65 72 62 20  |r for this verb |
00001830  74 6f 20 62 65 20 63 61  6c 6c 65 64 2e 20 42 6f  |to be called. Bo|
00001840  74 68 20 77 69 6c 6c 20  62 65 20 63 61 6c 6c 65  |th will be calle|
00001850  64 20 69 66 20 0a 70 72  65 73 61 6e 74 20 61 6e  |d if .presant an|
00001860  64 20 69 66 20 6e 65 69  74 68 65 72 20 69 73 20  |d if neither is |
00001870  70 72 65 73 61 6e 74 20  74 68 65 20 75 73 65 72  |presant the user|
00001880  20 69 73 20 74 6f 6c 64  20 68 65 20 68 61 73 20  | is told he has |
00001890  6d 61 64 65 20 61 6e 20  69 6e 76 61 6c 69 64 0a  |made an invalid.|
000018a0  69 6e 70 75 74 2e 20 54  68 69 73 20 69 73 20 74  |input. This is t|
000018b0  68 65 20 63 6f 64 65 20  61 64 64 65 64 20 74 6f  |he code added to|
000018c0  20 74 68 65 20 66 69 72  73 74 20 72 6f 6f 6d 3a  | the first room:|
000018d0  0a 0a 2e 2e 2e 0a 61 63  74 69 6f 6e 73 3a 20 7b  |......actions: {|
000018e0  0a 22 6a 75 6d 70 22 3a  20 70 72 69 6e 74 28 22  |."jump": print("|
000018f0  54 68 65 72 65 20 69 73  20 61 20 6c 61 72 67 65  |There is a large|
00001900  20 74 68 75 64 2e 5c 6e  22 29 0a 7d 0a 2e 2e 2e  | thud.\n").}....|
00001910  0a 0a 32 29 20 3c 56 65  72 62 3e 20 3c 4f 62 6a  |..2) <Verb> <Obj|
00001920  65 63 74 7c 70 65 72 73  6f 6e 3e 0a 0a 54 68 69  |ect|person>..Thi|
00001930  73 20 69 73 20 77 68 65  6e 20 61 6e 20 6f 62 6a  |s is when an obj|
00001940  65 63 74 20 68 61 73 20  61 6e 20 61 63 74 69 6f  |ect has an actio|
00001950  6e 20 64 6f 6e 65 20 74  6f 20 69 74 2e 20 46 6f  |n done to it. Fo|
00001960  72 20 74 68 69 73 20 74  79 70 65 20 74 6f 20 77  |r this type to w|
00001970  6f 72 6b 20 79 6f 75 20  0a 6d 75 73 74 20 68 61  |ork you .must ha|
00001980  76 65 20 61 6e 20 6f 62  6a 65 63 74 20 77 68 69  |ve an object whi|
00001990  63 68 20 68 61 73 20 3c  76 65 72 62 3e 20 69 6e  |ch has <verb> in|
000019a0  20 69 74 73 20 63 61 6e  64 6f 20 6c 69 73 74 20  | its cando list |
000019b0  6f 72 20 74 68 65 20 70  6c 61 79 65 72 20 6d 75  |or the player mu|
000019c0  73 74 20 68 61 76 65 20  3c 76 65 72 62 3e 20 69  |st have <verb> i|
000019d0  6e 20 69 74 73 20 63 61  6e 64 6f 20 6c 69 73 74  |n its cando list|
000019e0  2e 20 54 68 65 72 65 20  6d 75 73 74 20 61 6c 73  |. There must als|
000019f0  6f 20 62 65 20 3c 4f 62  6a 65 63 74 7c 50 65 72  |o be <Object|Per|
00001a00  73 6f 6e 3e 20 69 6e 20  74 68 65 20 72 6f 6f 6d  |son> in the room|
00001a10  2e 0a 43 6f 64 65 20 63  61 6c 6c 65 64 3a 20 61  |..Code called: a|
00001a20  29 43 75 72 72 65 6e 74  20 72 6f 6f 6d 27 73 20  |)Current room's |
00001a30  61 63 74 69 6f 6e 3a 20  69 66 20 69 74 20 68 61  |action: if it ha|
00001a40  73 20 3c 76 65 72 62 3e  0a 20 20 20 20 20 20 20  |s <verb>.       |
00001a50  20 20 20 20 20 20 62 29  4f 62 6a 65 63 74 20 6f  |      b)Object o|
00001a60  66 20 70 6c 61 79 65 72  27 73 20 63 61 6e 64 6f  |f player's cando|
00001a70  3a 20 69 66 20 69 74 20  68 61 73 20 3c 76 65 72  |: if it has <ver|
00001a80  62 3e 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |b>.             |
00001a90  63 29 50 6c 61 79 65 72  27 73 20 63 61 6e 64 6f  |c)Player's cando|
00001aa0  3a 20 69 66 20 69 74 20  68 61 73 20 3c 76 65 72  |: if it has <ver|
00001ab0  62 3e 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |b>.             |
00001ac0  64 29 3c 4f 62 6a 65 63  74 7c 70 65 72 73 6f 6e  |d)<Object|person|
00001ad0  3e 27 73 20 63 61 6e 62  65 3a 20 69 66 20 69 74  |>'s canbe: if it|
00001ae0  20 68 61 73 20 3c 76 65  72 62 3e 0a 0a 33 29 20  | has <verb>..3) |
00001af0  55 73 65 20 3c 6f 62 6a  65 63 74 3e 20 74 6f 20  |Use <object> to |
00001b00  3c 76 65 72 62 3e 20 3c  4f 62 6a 65 63 74 7c 70  |<verb> <Object|p|
00001b10  65 72 73 6f 6e 3e 0a 6f  72 20 3c 56 65 72 62 3e  |erson>.or <Verb>|
00001b20  20 3c 4f 62 6a 65 63 74  7c 70 65 72 73 6f 6e 3e  | <Object|person>|
00001b30  20 77 69 74 68 5c 75 73  69 6e 67 20 3c 4f 62 6a  | with\using <Obj|
00001b40  65 63 74 3e 0a 0a 54 68  69 73 20 69 73 20 73 69  |ect>..This is si|
00001b50  6d 69 6c 61 72 20 74 6f  20 32 29 20 65 78 63 65  |milar to 2) exce|
00001b60  70 74 20 74 68 61 74 20  79 6f 75 20 68 61 76 65  |pt that you have|
00001b70  20 74 6f 20 68 61 76 65  20 3c 6f 62 6a 65 63 74  | to have <object|
00001b80  3e 20 61 6e 64 20 69 74  73 20 63 61 6e 64 6f 3a  |> and its cando:|
00001b90  0a 63 6f 64 65 20 69 73  20 63 61 6c 6c 65 64 2c  |.code is called,|
00001ba0  20 69 66 20 69 74 20 68  61 73 20 3c 76 65 72 62  | if it has <verb|
00001bb0  3e 2c 20 69 6e 73 74 65  61 64 20 6f 66 20 61 2c  |>, instead of a,|
00001bc0  20 62 20 61 6e 64 20 63  2e 0a 0a 0a 32 20 61 6e  | b and c....2 an|
00001bd0  64 20 33 29 20 0a 49 74  20 69 73 20 69 6d 70 6f  |d 3) .It is impo|
00001be0  72 74 61 6e 74 20 74 20  6e 6f 74 65 20 74 68 61  |rtant t note tha|
00001bf0  74 20 69 73 20 74 68 65  20 6f 62 6a 65 63 74 20  |t is the object |
00001c00  6f 72 20 70 65 72 73 6f  6e 20 69 73 20 73 70 65  |or person is spe|
00001c10  63 69 66 69 65 64 20 69  6e 20 74 68 65 20 75 73  |cified in the us|
00001c20  65 72 0a 63 6f 6d 6d 61  6e 64 20 74 68 65 6e 20  |er.command then |
00001c30  69 74 20 64 6f 65 73 20  6e 6f 74 20 6d 61 74 74  |it does not matt|
00001c40  65 72 20 69 66 20 74 68  65 20 63 61 6e 64 6f 3a  |er if the cando:|
00001c50  2f 63 61 6e 62 65 3a 20  62 6c 6f 63 6b 73 20 68  |/canbe: blocks h|
00001c60  61 76 65 20 74 68 65 20  76 65 72 62 20 74 68 65  |ave the verb the|
00001c70  0a 61 63 74 69 6f 6e 73  20 74 68 65 20 63 6f 6d  |.actions the com|
00001c80  6d 61 6e 64 20 69 73 20  73 74 69 6c 6c 20 65 78  |mand is still ex|
00001c90  65 63 75 74 65 64 2e 0a  0a 54 6f 20 74 65 73 74  |ecuted...To test|
00001ca0  20 32 20 61 6e 64 20 74  68 69 73 20 49 20 77 69  | 2 and this I wi|
00001cb0  6c 6c 20 61 64 64 20 74  68 65 20 66 6f 6c 6c 6f  |ll add the follo|
00001cc0  77 69 6e 67 20 63 6f 64  65 20 74 6f 20 74 68 65  |wing code to the|
00001cd0  20 62 61 74 3a 0a 0a 2e  2e 2e 0a 63 61 6e 64 6f  | bat:......cando|
00001ce0  3a 20 7b 0a 22 68 69 74  22 3a 20 70 72 69 6e 74  |: {."hit": print|
00001cf0  28 22 59 6f 75 20 73 77  69 6e 67 20 74 68 65 20  |("You swing the |
00001d00  62 61 74 2e 5c 6e 22 29  0a 7d 0a 2e 2e 2e 0a 0a  |bat.\n").}......|
00001d10  41 6e 64 20 74 68 69 73  20 74 6f 20 74 68 65 20  |And this to the |
00001d20  6d 61 6e 3a 0a 0a 2e 2e  2e 0a 63 61 6e 62 65 3a  |man:......canbe:|
00001d30  20 7b 0a 22 68 69 74 22  3a 20 70 72 69 6e 74 28  | {."hit": print(|
00001d40  22 54 68 65 20 6d 61 6e  20 74 6f 70 70 6c 65 73  |"The man topples|
00001d50  20 6f 76 65 72 2e 22 29  0a 7d 0a 2e 2e 2e 0a 0a  | over.").}......|
00001d60  54 72 79 20 68 69 74 74  69 6e 67 20 74 68 65 20  |Try hitting the |
00001d70  6d 61 6e 20 77 69 74 68  20 61 6e 64 20 77 69 74  |man with and wit|
00001d80  68 6f 75 74 20 74 68 65  20 62 61 74 2e 0a 0a 45  |hout the bat...E|
00001d90  78 61 6d 70 6c 65 31 20  2d 20 4d 69 73 63 0a 2d  |xample1 - Misc.-|
00001da0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0a 4d  |--------------.M|
00001db0  6f 73 74 20 6f 66 20 74  68 65 20 72 65 73 74 20  |ost of the rest |
00001dc0  6f 66 20 74 68 65 20 6c  61 6e 67 75 61 67 65 20  |of the language |
00001dd0  63 61 6e 20 62 65 20 67  61 69 6e 65 64 20 66 72  |can be gained fr|
00001de0  6f 6d 20 74 68 65 20 4c  61 6e 67 75 61 67 65 20  |om the Language |
00001df0  66 69 6c 65 20 69 6e 20  74 68 69 73 0a 64 69 72  |file in this.dir|
00001e00  65 63 74 6f 72 79 2c 20  73 6f 20 70 6c 65 61 73  |ectory, so pleas|
00001e10  65 20 72 65 61 64 20 69  74 2e 20 41 6c 73 6f 20  |e read it. Also |
00001e20  74 68 65 20 45 78 61 6d  70 6c 65 31 20 66 69 6c  |the Example1 fil|
00001e30  65 20 63 6f 6e 74 61 69  6e 73 20 61 20 73 6c 69  |e contains a sli|
00001e40  67 68 74 6c 79 20 0a 6c  61 72 67 65 72 20 65 78  |ghtly .larger ex|
00001e50  61 6d 70 6c 65 20 77 68  69 63 68 20 79 6f 75 20  |ample which you |
00001e60  6d 61 79 20 77 61 6e 74  20 74 6f 20 6c 6f 6f 6b  |may want to look|
00001e70  20 61 74 2e 20 48 65 72  65 20 69 73 20 61 20 73  | at. Here is a s|
00001e80  75 6d 6d 61 72 79 20 6f  66 20 74 68 65 20 72 65  |ummary of the re|
00001e90  73 74 0a 6f 66 20 74 68  65 20 6c 61 6e 67 75 61  |st.of the langua|
00001ea0  67 65 3a 0a 0a 61 29 20  65 6e 65 72 67 79 3a 2f  |ge:..a) energy:/|
00001eb0  64 65 61 64 3a 0a 65 6e  65 72 67 79 3a 20 69 73  |dead:.energy: is|
00001ec0  20 66 6f 6c 6c 6f 77 65  64 20 62 79 20 61 20 76  | followed by a v|
00001ed0  61 6c 75 65 20 77 68 69  63 68 20 69 73 20 74 68  |alue which is th|
00001ee0  65 20 65 6e 65 72 67 79  20 6f 66 20 74 68 65 20  |e energy of the |
00001ef0  6f 62 6a 65 63 74 2c 20  70 65 72 73 6f 6e 20 6f  |object, person o|
00001f00  72 0a 70 6c 61 79 65 72  2e 20 20 49 66 20 74 68  |r.player.  If th|
00001f10  65 20 65 6e 65 72 67 79  20 65 76 65 72 20 70 61  |e energy ever pa|
00001f20  73 73 65 73 20 74 68 72  6f 75 67 68 20 6f 72 20  |sses through or |
00001f30  74 6f 20 7a 65 72 6f 20  66 72 6f 6d 20 61 20 70  |to zero from a p|
00001f40  6f 73 69 74 69 76 65 20  76 61 6c 75 65 20 0a 74  |ositive value .t|
00001f50  68 65 20 64 65 61 64 3a  20 63 6f 64 65 20 69 73  |he dead: code is|
00001f60  20 63 61 6c 6c 65 64 2e  20 54 68 65 20 65 6e 65  | called. The ene|
00001f70  72 67 79 20 63 61 6e 20  62 65 20 63 68 61 6e 67  |rgy can be chang|
00001f80  65 64 20 69 6e 20 63 6f  64 65 2c 20 73 65 65 20  |ed in code, see |
00001f90  6c 61 74 65 72 2e 0a 49  74 20 69 73 20 75 73 65  |later..It is use|
00001fa0  20 69 6e 20 45 78 61 6d  70 6c 65 31 20 66 6f 72  | in Example1 for|
00001fb0  20 74 68 65 20 62 6f 78  20 28 68 69 74 20 74 68  | the box (hit th|
00001fc0  65 20 62 6f 78 20 74 77  69 63 65 20 77 69 74 68  |e box twice with|
00001fd0  20 74 68 65 20 62 61 74  2e 29 0a 0a 62 29 20 76  | the bat.)..b) v|
00001fe0  61 72 69 61 62 6c 65 73  0a 56 61 72 69 61 62 6c  |ariables.Variabl|
00001ff0  65 73 20 61 72 65 20 75  73 65 64 20 74 6f 20 73  |es are used to s|
00002000  74 6f 72 65 20 77 68 6f  6c 65 20 6e 75 6d 62 65  |tore whole numbe|
00002010  72 73 20 74 68 65 79 20  61 72 65 20 64 65 66 69  |rs they are defi|
00002020  6e 65 64 20 69 6e 20 74  68 65 20 66 69 6c 65 20  |ned in the file |
00002030  77 69 74 68 20 61 0a 73  74 61 72 74 20 76 61 6c  |with a.start val|
00002040  75 65 2c 20 73 65 65 20  74 68 65 20 45 78 61 6d  |ue, see the Exam|
00002050  70 6c 65 31 20 66 69 6c  65 2e 20 54 68 65 79 20  |ple1 file. They |
00002060  63 61 6e 20 62 65 20 63  68 61 6e 67 65 64 20 61  |can be changed a|
00002070  6e 64 20 74 65 73 74 65  64 20 62 79 20 63 6f 64  |nd tested by cod|
00002080  65 2e 0a 41 20 44 65 66  69 6e 69 74 69 6f 6e 20  |e..A Definition |
00002090  6c 6f 6f 6b 73 20 6c 69  6b 65 20 74 68 69 73 3a  |looks like this:|
000020a0  0a 0a 76 61 72 69 61 62  6c 65 20 78 20 3d 20 39  |..variable x = 9|
000020b0  0a 0a 63 29 20 63 6f 64  65 0a 54 68 65 72 65 20  |..c) code.There |
000020c0  68 61 73 20 62 65 65 6e  20 61 20 6c 6f 74 20 6f  |has been a lot o|
000020d0  66 20 74 61 6c 6b 20 6f  66 20 63 6f 64 65 2c 20  |f talk of code, |
000020e0  61 73 20 77 65 6c 6c 20  61 73 20 74 68 65 20 73  |as well as the s|
000020f0  69 6e 67 6c 65 20 69 6e  73 74 72 75 63 74 69 6f  |ingle instructio|
00002100  6e 73 0a 75 73 65 64 20  69 6e 20 74 68 65 20 61  |ns.used in the a|
00002110  62 6f 76 65 20 65 78 61  6d 70 6c 65 73 20 74 68  |bove examples th|
00002120  65 72 65 20 61 72 65 20  61 6c 73 6f 20 6d 75 6c  |ere are also mul|
00002130  74 69 2d 6c 69 6e 65 20  63 6f 64 65 20 62 6c 6f  |ti-line code blo|
00002140  63 6b 73 20 77 68 69 63  68 20 73 74 61 72 74 0a  |cks which start.|
00002150  77 69 74 68 20 61 20 7b  20 74 68 65 6e 20 61 20  |with a { then a |
00002160  72 65 74 75 72 6e 20 61  6e 64 20 65 6e 64 20 77  |return and end w|
00002170  69 74 68 20 61 20 7d 20  6f 6e 20 69 74 73 20 6f  |ith a } on its o|
00002180  77 6e 20 6c 69 6e 65 2e  20 49 6e 20 62 65 74 77  |wn line. In betw|
00002190  65 65 6e 20 63 61 6e 20  62 65 0a 74 68 65 20 66  |een can be.the f|
000021a0  6f 6c 6c 6f 77 69 6e 67  20 63 6f 6d 6d 61 6e 64  |ollowing command|
000021b0  73 3a 0a 0a 20 20 70 72  69 6e 74 28 73 74 72 69  |s:..  print(stri|
000021c0  6e 67 2f 76 61 72 69 61  62 6c 65 29 20 20 20 20  |ng/variable)    |
000021d0  20 2d 20 6f 75 74 70 75  74 0a 20 0a 20 20 67 6f  | - output. .  go|
000021e0  74 6f 28 6c 61 62 65 6c  29 20 20 20 20 20 20 20  |to(label)       |
000021f0  20 20 20 20 20 20 20 20  20 2d 20 67 6f 74 6f 20  |         - goto |
00002200  72 6f 6f 6d 0a 0a 20 20  50 5f 6d 6f 76 65 28 3c  |room..  P_move(<|
00002210  70 65 72 73 6f 6e 3e 2c  3c 72 6f 6f 6d 3e 29 20  |person>,<room>) |
00002220  20 20 20 2d 20 4d 6f 76  65 73 20 61 20 70 65 72  |   - Moves a per|
00002230  73 6f 6e 20 74 6f 20 61  20 72 6f 6f 6d 2e 20 0a  |son to a room. .|
00002240  0a 20 20 4f 5f 6d 6f 76  65 28 3c 6f 62 6a 65 63  |.  O_move(<objec|
00002250  74 3e 2c 3c 72 6f 6f 6d  3e 29 20 20 20 20 2d 20  |t>,<room>)    - |
00002260  4d 6f 76 65 73 20 61 20  6f 62 6a 65 63 74 20 74  |Moves a object t|
00002270  6f 20 61 20 72 6f 6f 6d  20 0a 0a 20 20 65 6e 64  |o a room ..  end|
00002280  28 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |()              |
00002290  20 20 20 20 20 20 20 20  2d 20 45 6e 64 73 20 74  |        - Ends t|
000022a0  68 65 20 67 61 6d 65 0a  0a 20 20 63 68 61 6e 67  |he game..  chang|
000022b0  65 28 3c 76 61 72 69 61  62 6c 65 3e 2c 3c 69 6e  |e(<variable>,<in|
000022c0  74 3e 29 20 20 20 2d 20  63 68 61 6e 67 65 73 20  |t>)   - changes |
000022d0  3c 76 61 72 69 61 62 6c  65 3e 2f 65 6e 65 72 67  |<variable>/energ|
000022e0  79 20 62 79 20 3c 69 6e  74 3e 0a 0a 20 20 73 65  |y by <int>..  se|
000022f0  74 28 3c 76 61 72 69 61  62 6c 65 3e 2c 3c 69 6e  |t(<variable>,<in|
00002300  74 3e 29 20 20 20 20 20  20 2d 20 73 65 74 20 3c  |t>)      - set <|
00002310  76 61 72 69 61 62 6c 65  3e 2f 65 6e 65 72 67 79  |variable>/energy|
00002320  20 74 6f 20 3c 69 6e 74  3e 0a 0a 20 20 69 66 28  | to <int>..  if(|
00002330  3c 76 61 72 69 61 62 6c  65 3e 2c 3c 63 6f 6e 64  |<variable>,<cond|
00002340  69 74 69 6f 6e 3e 29 20  2d 20 73 65 65 20 6c 61  |ition>) - see la|
00002350  6e 67 75 61 67 65 0a 0a  54 68 65 72 65 20 69 73  |nguage..There is|
00002360  20 61 20 6d 6f 72 65 20  64 65 74 61 6c 65 64 20  | a more detaled |
00002370  64 65 73 63 72 69 70 74  69 6f 6e 20 69 6e 20 74  |description in t|
00002380  68 65 20 6c 61 6e 67 75  61 67 65 20 66 69 6c 65  |he language file|
00002390  2e 0a 0a 64 29 20 73 65  65 3a 2f 75 6e 73 65 65  |...d) see:/unsee|
000023a0  3a 0a 54 68 69 73 20 73  70 65 63 69 66 69 65 73  |:.This specifies|
000023b0  20 63 6f 64 65 20 77 68  69 63 68 20 77 69 6c 6c  | code which will|
000023c0  20 62 65 20 63 61 6c 6c  65 64 20 77 68 65 6e 20  | be called when |
000023d0  61 20 70 65 72 73 6f 6e  20 73 65 65 73 20 79 6f  |a person sees yo|
000023e0  75 20 6f 72 20 75 6e 73  65 65 73 0a 79 6f 75 2e  |u or unsees.you.|
000023f0  0a 0a 65 29 20 6c 65 61  76 65 3a 2f 65 6e 74 65  |..e) leave:/ente|
00002400  72 3a 0a 43 6f 64 65 20  69 6e 20 61 20 72 6f 6f  |r:.Code in a roo|
00002410  6d 20 74 6f 20 62 65 20  63 61 6c 6c 65 64 20 77  |m to be called w|
00002420  68 65 6e 20 79 6f 75 20  65 6e 74 65 72 20 6f 72  |hen you enter or|
00002430  20 6c 65 61 76 65 2e 0a  0a 66 29 20 52 6f 6f 6d  | leave...f) Room|
00002440  20 6e 75 6c 6c 0a 54 68  65 72 65 20 69 73 20 61  | null.There is a|
00002450  20 72 6f 6f 6d 20 63 61  6c 6c 65 64 20 27 6e 75  | room called 'nu|
00002460  6c 6c 27 20 77 68 69 63  68 20 6f 62 6a 65 63 74  |ll' which object|
00002470  73 20 63 61 6e 62 65 20  73 65 6e 74 20 74 6f 20  |s canbe sent to |
00002480  74 6f 20 6d 61 6b 65 20  74 68 65 6d 0a 64 69 73  |to make them.dis|
00002490  61 70 65 61 72 2e                                 |apear.|
00002496