-.. raw:: latex
-
- \newpage
-
=================
Heidi revisited
=================
need to substitute a more relevant response after LISTEN TO BIRD. Here's
how we do it:
-.. code-block:: inform6
+.. code-block:: inform
Object bird "baby bird" forest
with description "Too young to fly, the nestling tweets helplessly.",
though it hadn't been intercepted. Sometimes that's what you want it to
do, but not here: if instead we'd written this:
-.. code-block:: inform6
+.. code-block:: inform
Object bird "baby bird" forest
with description "Too young to fly, the nestling tweets helplessly.",
Again, that isn't perhaps the most appropriate response, but it's easy to
change:
-.. code-block:: inform6
+.. code-block:: inform
Object before_cottage "In front of a cottage"
with description
That's easy to fix; we can add a new ``cottage`` object, making it a piece
of ``scenery`` just like the ``tree``:
-.. code-block:: inform6
+.. code-block:: inform
Object cottage "tiny cottage" before_cottage
with description "It's small and simple, but you're very happy here.",
The situation here is similar to our LISTEN TO BIRD problem, and the
solution we adopt is similar as well:
-.. code-block:: inform6
+.. code-block:: inform
Object cottage "tiny cottage" before_cottage
with description "It's small and simple, but you're very happy here.",
turns out that the sequence "``print`` a string which ends with a newline
character, and then ``return true``" is so frequently needed that there's a
special statement which does it all. That is, this single statement (where
-you'll note that the string doesn't need to end in ``^``)::
+you'll note that the string *doesn't* need to end in ``^``)::
print_ret "It's such a lovely day -- much too nice to go inside.";
to be achieved by that"). Yet another opportunity to use a ``before``
property, but now with a difference.
-.. code-block:: inform6
+.. code-block:: inform
Object tree "tall sycamore tree" clearing
with description
far, but instead for every ``Drop`` which takes place in our troublesome
``top_of_tree`` room. This is what we have to write:
-.. code-block:: inform6
+.. code-block:: inform
Object top_of_tree "At the top of the tree"
with description "You cling precariously to the trunk.",
unhelpful in these non-standard circumstances. If you prefer to hint at
what's just happened, you could use this alternative solution:
-.. code-block:: inform6
+.. code-block:: inform
Object top_of_tree "At the top of the tree"
with description "You cling precariously to the trunk.",
checked for the bird actually being in the nest; fortunately, that's easy
to do:
-.. code-block:: inform6
+.. code-block:: inform
Object branch "wide firm bough" top_of_tree
with description "It's flat enough to support a small object.",
if (bird in nest && nest in branch) deadflag = 2;
should now be read as: "Test whether the ``bird`` is currently in (or on)
-the ``nest``, and whether the ``nest`` is currently on (or in) the
+the ``nest``, *and* whether the ``nest`` is currently on (or in) the
``branch``; if both parts are ``true``, set the value of ``deadflag`` to 2;
otherwise, do nothing".