We start out by giving ourselves a capacious recording device:
"If It Hadn't Been For..."
The digital recorder is a device. The description is "A noise-activated recorder, which time-stamps each recording segment. It has space for about 60 short recordings."
Every turn:
if the digital recorder is switched on and the number of blank rows in the Table of Recorded Content is 0, now the recorder is switched off.
Table of Recorded Content
time stamp
|
sound
|
a time
|
some text
|
with 60 blank rows.
|
And most of what follows is attaching sounds to various events. (We could have made noises associated with all the actions, but for simplicity we stuck to a few.)
The thing to note here is that the recording happens as part of Carry out, not as part of Report, so sounds will be recorded even when they are the result of non-player action when the player is not even in the room.
Carry out opening something in the presence of the switched on recorder:
record "A creaking noise, as of something being opened."
Carry out someone opening something when the switched on recorder can see the noun:
record "A creaking noise, as of something being opened."
Carry out closing something in the presence of the switched on recorder:
record "A creaking followed by a slam."
Carry out someone closing something in the presence of the switched on recorder:
record "A creaking followed by a slam."
Carry out someone going to a room (called destination) in the presence of the switched on recorder:
if the destination is the holder of the recorder, record "Footsteps, growing louder.";
otherwise record "Footsteps, fading out."
Carry out going to a room (called destination) in the presence of the switched on recorder:
if the destination is the holder of the recorder, record "Footsteps, growing louder.";
otherwise record "Footsteps, fading out."
Carry out someone eating something in the presence of the switched on recorder:
record "Loud uncouth chewing sounds."
Carry out eating something in the presence of the switched on recorder:
record "Distant muffled chewing sounds."
To record (noise - some text):
if the number of blank rows in the Table of Recorded Content is 0, rule succeeds;
choose a blank row in the Table of Recorded Content;
now time stamp entry is the time of day;
now sound entry is noise.
Understand "play [something]" as listening.
Instead of listening to the recorder:
if the number of filled rows in the Table of Recorded Content is 0, say "The recorder remains blank." instead;
repeat through the Table of Recorded Content:
say "[line break][time stamp entry]: [sound entry]";
say paragraph break.
The Haunted House is a room. The squeaky cupboard is an openable enterable closed fixed in place container in the House. The ghost is a man in the cupboard. The Lawn is outside from the Haunted House.
Instead of opening the closed cupboard when the ghost is in the cupboard: say "The cupboard stubbornly refuses to open."
Every turn when the player is not in the House:
if the ghost is in the cupboard:
try the ghost exiting;
otherwise if the cupboard is open:
try the ghost closing the cupboard.
Before someone exiting when the person asked is in a closed container (called the trap):
try the person asked opening the trap.
Before someone entering a closed container: try the person asked opening the noun.
Before going to the House when the House contains the ghost:
try the ghost entering the cupboard;
try the ghost closing the cupboard.
The player carries the recorder, chips, and a sandwich. The sandwich is edible. The chips are edible.
Carry out someone eating the chips in the presence of the switched on recorder: record "An incredible racket of a packet being opened." Carry out eating the chips in the presence of the switched on recorder: record "An incredible racket of a packet being opened."
Test me with "open cupboard / drop recorder / switch it on / eat chips / out / wait / wait / wait / in / switch recorder off / play recorder".
Now we're at liberty to record evidence of the ghost getting out of the cupboard and getting back in, while we ourselves stand about on the lawn.
We rely here on the understanding-by-relations rules we've already learned, but there is an additional trick: we want to make sure that if the player types "original" or "actual", this word will not be taken to refer to the thing modeled:
"Originals"
A model is a kind of thing. 10 models are in the model-repository.
Appearance relates one thing to various models. The verb to be shown by means the appearance relation.
Indication relates a model (called X) to a thing (called Y) when Y is shown by X and Y is suitable.
Understand "actual" or "original" as "[actual]". Understand "[actual]" as something when the item described is not a model.
Definition: a thing is suitable:
if the player's command includes "[actual]", no;
yes.
Understand "[something related by indication]" as a model.
After printing the name of a model (called target): say " [random thing shown by the target]"
Now our duplication command -- for the sake of simplicity, we'll suppose that in this scenario the player is duplicating objects by magic rather than creating them out of physical materials or supplies:
Understand "duplicate [something]" as duplicating. Duplicating is an action applying to one visible thing.
The duplicating action has an object called the selected model.
Setting action variables for duplicating:
let N be a random model in the model-repository;
now the selected model is N.
Check duplicating:
if the selected model is nothing, say "You're out of power." instead.
Carry out duplicating:
now the noun is shown by the selected model;
move the selected model to the player.
Report duplicating:
say "You concentrate and manifest [a selected model]."
Now, the challenge is that we want to print the word "actual" before printing the name of an object, but only during disambiguation questions and only when we are not printing the name of the object as part of a model-name! (If we are not careful about the latter point, we will get responses such as "Which do you mean, the model actual deer or the actual deer?" which of course defeats the whole purpose.
The way around this is to remember that activities stack: we're printing the name of the deer while printing the name of a model that involves the deer. So if we set a flag while printing the name of a model, we can control the way the deer's name prints during the transaction. (We could use our ...while clause to specify while not printing the name of a model, except that we're already using it for "while asking which do you mean", and these do not stack.) So:
The virtual-context is a truth state that varies. The virtual-context is false.
Before printing the name of a model:
now virtual-context is true.
After printing the name of a model:
now virtual-context is false.
Before printing the name of something (called target) while asking which do you mean:
if the target is not a model and virtual-context is false:
say "actual ".
Forest is a room. It contains a deer and a daisy. The deer is an animal.
Test me with "duplicate deer / x model deer / x deer model / drop deer / x deer / actual / x deer / model".
"Mirror, Mirror"
The Sorcerer's Workshop is a room. "The sorcerer's den is a dusty, whispering place. A grandfather clock with skeletal hands reads [the time of day in words]. The floorboards are stained where that porridge just wouldn't come out."
The Apprentice's Pantry is east of the Workshop. "This is where the aproned apprentice traditionally makes the camomile tea, cleans out the jackdaw cages and furtively examines purloined artefacts."
When play begins: erase the mirror.
The player carries a magic mirror. The magic mirror has a text called the mirror vision.
To erase the mirror: now mirror vision of the mirror is "The mirror is polished clean, and has no impression upon it."
To say current room description: try looking.
To expose the mirror:
say "The mirror shines momentarily with a dazzling light.[paragraph break]";
now mirror vision of the mirror is the substituted form of "The hazy image in the mirror preserves a past sight:[line break][current room description]All is distorted and yet living, as though the past and present are coterminous in the mirror."
Understand "hold up [something preferably held]" or "hold [something preferably held] up" as holding aloft. Holding aloft is an action applying to one carried thing. Report holding aloft: say "You hold [the noun] aloft."
Instead of rubbing the mirror: erase the mirror; try examining the mirror. Instead of holding aloft the mirror: expose the mirror.
The description of the mirror is "[mirror vision of the mirror]".
Test me with "look / examine mirror / hold up mirror / z / look / x mirror / rub mirror / east / hold mirror up / west / x mirror".
Here we construct a video camera to track and play back actions:
"The Actor's Studio"
Section 1 - The Video Camera
The video camera is a thing carried by the player.
Table of Videotape
recorded action
|
time stamp
|
waiting
|
9:00 AM
|
with 25 blank rows.
|
Mode is a kind of value. The modes are idle, recording, and playing back. The video camera has a mode. The video camera is idle.
Understand "play back" as playing back. Instead of switching on the camera, try tuning the camera to recording. Instead of switching off the camera, try tuning the camera to idle.
The description of the video camera is "It is currently [mode]; its available settings are idle, recording, and playing back."
Understand "set [camera] to [a mode]" as tuning it to. Tuning it to is an action applying to one thing and one mode.
Instead of setting the camera to something:
say "The available settings are idle, recording, and playing back."
Check tuning it to:
if the noun is not the camera, say "Only the video camera can be set to [the mode understood]." instead.
Carry out tuning it to:
now the mode of the noun is the mode understood.
Report tuning it to:
say "You set [the noun] to [mode understood]."
After an actor doing something when the video camera is recording:
if the current action is tuning the video camera to recording, make no decision;
if the number of blank rows in the Table of Videotape is greater than zero:
choose a blank row in the Table of Videotape;
now the recorded action entry is the current action;
now the time stamp entry is the time of day;
otherwise:
now the video camera is idle;
say "The video camera runs out of recording memory and switches off.";
continue the action.
Every turn when the video camera is playing back:
say "On the camera screen, you see [run paragraph on]";
let starting playback be false;
repeat through the Table of Videotape:
if the recorded action entry is not waiting:
now starting playback is true;
say "[line break] -- [if the actor part of the recorded action entry is the player]you [end if][the recorded action entry], time stamped at [time stamp entry]";
blank out the whole row;
if starting playback is false, say "only static.";
otherwise say paragraph break.
Section 2 - The Scenario
The Actor's Studio is a room. Lucas is a man in the Actor's Studio. Persuasion rule: persuasion succeeds.
The Studio contains an edible thing called a croissant.
Test me with "set camera to recording / x lucas / lucas, take inventory / lucas, eat croissant / set camera to playing back / z".
Notice that both Lucas' implied taking action (picking up the croissant) and his eating action are recorded on the same move.
We start by creating a camera and a photograph object. As usual when we want to have a kind of object that can be dispensed in bulk, we start off with a bunch of identical instances of the object out of play (in this case, kept in an out-of-play container called "film roll"); we can then move them into play and give them characteristics when they're needed.
Each photograph can depict exactly one thing -- we're assuming that the player is not a landscape photographer here -- so we create a relation to indicate what is shown by each photograph. We'll then use that relation to determine how photographs are described, named, and parsed:
"Claims Adjustment"
A photograph is a kind of thing. 36 photographs are in the film roll.
Appearance relates one thing to various photographs. The verb to be shown by means the appearance relation.
The description of a photograph is usually "It shows [a random thing which is shown by the item described]."
Understand "of [something related by reversed appearance]" as a photograph.
This allows the player to refer to any photograph by its subject: useful if we have a large number of them.
Now we create an action to let the player use the camera and generate these photograph objects:
The player carries a cheap instant camera.
Understand "photograph [something] with [camera]" as photographing. Understand "photograph [something] with [something preferably held]" as photographing. Photographing is an action applying to one visible thing and one carried thing, requiring light.
The photographing action has an object called the selected film.
Setting action variables for photographing:
let N be a random photograph in the film roll;
now the selected film is N.
Check photographing:
if the second noun is not the camera, say "You need a camera for that purpose." instead.
Check photographing:
if the noun is the camera, say "Sadly impossible." instead.
Check photographing:
if the selected film is nothing, say "You're out of film." instead.
Carry out photographing:
now the noun is shown by the selected film;
move the selected film to the player.
Report photographing:
say "Your camera instantly spits out [a selected film]."
Now we use two activities from the Activities chapter to describe the photographs to the player more elegantly:
After printing the name of a photograph (called target):
say " of [a random thing which is shown by the target]".
After printing the plural name of a photograph (called target):
let N be the holder of the target;
say " of [a list of things which are shown by photographs which are held by N]";
if the number of things which are shown by photographs which are held by N is greater than one, say " (variously)".
And finally we provide a brief scenario to give the player something to take pictures of:
The Treasure Room is a room. "Despite the fancy name, this is no more than a closet -- albeit a closet with its own special circuit on the house alarm."
The Treasure Room contains a small Degas, a Ming vase, and a collection of South African krugerrands. The player is carrying insurance forms, a first-class stamp, and a security envelope.
The description of the forms is "Completely filled out in black ink in block letters: now all you need to do is attach photographic evidence of the objects you wish to insure."
Test me with "photograph degas / i / photograph degas / i / x photograph of degas / photograph me / x photograph of me / i / photograph vase / photograph camera / photograph collection / g / i / test more".
Test more with "x photograph of collection / x photograph of krugerrands / x photograph of collection of south african krugerrands / photograph photograph of degas / x photograph of photograph of degas".