| *H was a hunter, and hunted a buck.*
.. only:: html
+
.. image:: /images/picG.png
:align: left
location = before_cottage;
-to reset the value of the location variable to the ``before_cottage``
-object, and we wrote::
+to reset the value of the ``location`` variable to the
+``before_cottage`` object, and we wrote::
if (nest in branch) deadflag = 2;
indeed the player herself is also an object (one that's automatically
defined by the library).
+.. todo::
+
+ The set-off below needs to be tweaked or perhaps a custom lexer
+ created to get italics in the right places.
+
The general model of an **object** definition looks like this::
Object obj_id "external_name" parent_obj_id
of the player (and *not* of the forest), and the player is both a parent
(of the bird) and a child (of the forest).
-In this diagram, we show how the object relationships change during the
-course of the game. The straight lines represent parent--child
-relationships, with the parent object at the top of the line, and the child
-object at the bottom.
+Here we show how the object relationships change during the course of the
+game. The straight lines represent parent--child relationships, with the
+parent object at the top of the line, and the child object at the bottom.
+
+1. At the start of the game:
+
+ .. blockdiag:: /figures/heidiobj1.diag
+ :align: center
+ :scale: 80%
+
+2. The player types: ``GO EAST``
+
+ .. blockdiag:: /figures/heidiobj2.diag
+ :align: center
+ :scale: 80%
+
+3. The player types: ``TAKE THE BIRD``
+
+ .. blockdiag:: /figures/heidiobj3.diag
+ :align: center
+ :scale: 80%
+
+4. The player types: ``GO NORTHEAST``
-.. list-table::
- :widths: 1 3 5
+ .. blockdiag:: /figures/heidiobj4.diag
+ :align: center
+ :scale: 80%
- * - 1.
- - At the start of the game:
- - .. image:: /images/heidiobj1.*
+5. The player types: ``PUT BIRD IN NEST``
- * - 2.
- - The player types: ``GO EAST``
- - .. image:: /images/heidiobj2.*
+ .. blockdiag:: /figures/heidiobj5.diag
+ :align: center
+ :scale: 80%
- * - 3.
- - The player types: ``TAKE THE BIRD``
- - .. image:: /images/heidiobj3.*
+6. The player types: ``TAKE NEST``
- * - 4.
- - The player types: ``GO NORTHEAST``
- - .. image:: /images/heidiobj4.*
+ .. blockdiag:: /figures/heidiobj6.diag
+ :align: center
+ :scale: 80%
- * - 5.
- - The player types: ``PUT BIRD IN NEST``
- - .. image:: /images/heidiobj5.*
+7. The player types: ``UP``
- * - 6.
- - The player types: ``TAKE NEST``
- - .. image:: /images/heidiobj6.*
+ .. blockdiag:: /figures/heidiobj7.diag
+ :align: center
+ :scale: 80%
- * - 7.
- - The player types: ``UP``
- - .. image:: /images/heidiobj7.*
+8. The player types: ``PUT NEST ON BRANCH``
- * - 8.
- - The player types: ``PUT NEST ON BRANCH``
- - .. image:: /images/heidiobj8.*
+ .. blockdiag:: /figures/heidiobj8.diag
+ :align: center
+ :scale: 80%
In this short example, we've taken a lot of time and space to spell out
exactly how the objects relationship patterns -- generally known as the
.. rubric:: Double quotes
-Double quotes "..." surround a **string** -- a letter, a word, a paragraph,
-or almost any number of characters -- which you want the interpreter to
-display while the game is being played. You can use the tilde ``~`` to
-represent a double quote inside the string, and the circumflex ``^`` to
-represent a newline (line break) character. Upper-case and lower-case
-letters are treated as different.
+Double quotes ``"..."`` surround a **string** -- a letter, a word, a
+paragraph, or almost any number of characters -- which you want the
+interpreter to display while the game is being played. You can use the
+tilde ``~`` to represent a double quote inside the string, and the
+circumflex ``^`` to represent a newline (line break) character.
+Upper-case and lower-case letters are treated as different.
-A long string can be split over several lines; Inform transforms each line
-break (and any spaces around it) into a single space (extra spaces not at a
-line break are preserved, though). These two strings are equivalent::
+A long string can be split over several lines; Inform transforms each
+line break (and any spaces around it) into a single space (extra spaces
+*not* at a line break are preserved, though). These two strings are
+equivalent::
"This is a string of characters."
Constant Headline
"^A simple Inform example^by Roger Firth and Sonja Kesserich.^";
-and as the value of an object description property::
+and as the value of an object ``description`` property::
description "Too young to fly, the nestling tweets helplessly.",
.. rubric:: Single quotes
-Single quotes '...' surround a **dictionary word**. This has to be a
-single word -- no spaces -- and generally contains only letters (and
-occasionally numbers and hyphens), though you can use ``^`` to represent an
-apostrophe inside the word. Upper-case and lower-case letters are treated
-as identical; also, the interpreter normally looks only at the first nine
-characters of each word that the player types.
+Single quotes ``'...'`` surround a **dictionary word**. This has to be
+a single word -- no spaces -- and generally contains only letters (and
+occasionally numbers and hyphens), though you can use ``^`` to represent
+an apostrophe inside the word. Upper-case and lower-case letters are
+treated as identical; also, the interpreter normally looks only at the
+first nine characters of each word that the player types.
When the player types a command, the interpreter divides what was typed
into individual words, which it then looks up in the dictionary. If it
deadflag = 2;
-which changes the value of the library variable ``deadflag`` from its
-current value to 2. Incidentally, if statements are often written on two
-lines, with the "controlled" statement indented. This makes it easier to
-read, but doesn't change the way that it works::
+which changes the value of the library variable ``deadflag`` from its
+current value to 2. Incidentally, ``if`` statements are often written
+on two lines, with the "controlled" statement indented. This makes it
+easier to read, but doesn't change the way that it works::
if (nest in branch)
deadflag = 2;
You may have noticed that, although we've defined a routine named
``Initialise``, we've never actually called it. Don't worry -- the
- routine is called, by the Inform library, right at the start of a game.
+ routine *is* called, by the Inform library, right at the start of a
+ game.
.. rubric:: Embedded routines