![]() | Chapter 15: Tables | ![]() ![]() |
15.4. Changing entries |
Here is another rather definitive, immutable-looking table:
Table 4 - Recent Monarchs
Name Accession Family "Anne" 1702 Stuart "George I" 1714 Hanover "George II" 1720 Hanover "George III" 1760 Hanover "George IV" 1820 Hanover "William IV" 1830 Hanover "Victoria" 1837 Hanover "Edward VII" 1901 Saxe-Coburg-Gotha "George V" 1910 Windsor "Edward VIII" 1936 Windsor "George VI" 1936 Windsor "Elizabeth II" 1952 Windsor
But table entries can be changed as freely as variables: that is, any value can be entered so long as it has the right kind. We cannot put a dynasty into the "Name" column, or text in the "Accession" column. The phrase needed is "now ... is ...", just as it is for properties or variables:
Dynasty is a kind of value. The dynasties are Stuart, Hanover, Saxe-Coburg-Gotha and Windsor.
The Table Office is a room. The Succession is in the Table Office. "The Succession, a ponderous list of English monarchs, takes pride of place."
Instead of examining the Succession:
say "The Succession List runs as follows...";
repeat with N running from 1 to the number of rows in the Table of Recent Monarchs:
say "[accession in row N of Table 4]: [name in row N of Table 4] ([family in row N of Table 4])."
Instead of attacking the Succession:
now the family corresponding to an accession of 1720 in the Table of Recent Monarchs is Stuart;
now the name in row 4 of the Table of Recent Monarchs is "Graham I";
now the name in row 5 of the Table of Recent Monarchs is "Trixibelle IV";
say "You deface the English succession, making suitable amendments with a quill pen. Considering it is supposed to be mightier than the sword the effect is a little disappointing."
Test me with "examine succession / attack it / examine it".
Previous | Contents | Next |