15.9. Blank rows

| Chapter 15: Tables |

| 15.9. Blank rows

There is no difficulty about entirely blank rows: or rather, the only difficulty is once again that they are boring to type out. We can avoid the necessity by appending "with ... blank rows" at the foot of the table:

> Table 2 - Selected Elements

> Element | Symbol | Atomic number | Atomic weight
> "Hydrogen" | "H" | 1 | a number
> "Iron" | "Fe" | 26 | --
> "Zinc" | "Zn" | 30 | --
> "Uranium" | "U" | 92 | --
> with 3 blank rows

(These words cannot be placed in between rows, but only at the bottom.) And indeed the table can start out completely empty:

> Table 3 - Undiscovered Periodic Table

> Element (text) | Symbol (text) | Atomic number (a number) | Atomic weight (a number)
> with 92 blank rows

Blank rows are useful because they enable us to add new data to a table. In effect, they are invisible when not used. A repeat loop like

> repeat through Table 3:
> ...

automatically skips blank rows, so it would initially do nothing at all. Similarly, choosing a "random" row will never choose a blank one.

A convenient way to test if a table contains non-blank rows is to use the built-in adjectives "empty" and "non-empty". So:

> if the Undiscovered Periodic Table is empty, ...

tests whether all of its rows are blank; if even one cell contains a value then the table is "non-empty".

262
| Example If It Hadn't Been For... A sound recording device that records the noises made by player and non-player actions, then plays them back on demand. |
RB

> 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.

Previous | Contents | Next