Channel 2
Our previous implementation of televisions ("Channel 1") doesn't allow the player to type things like
nor does it deal with player input like
or
where no television is specified. When we are designing commands which involve two elements (here, a television and a channel number), it's usually a good idea to allow the player to specify those elements in either order, as we saw demonstrated briefly in "New commands for old grammar".
We might, therefore, want to add a few refinements: first by defining a "[channel]" token that will accept input of the forms "[number]" and "channel [number]", and second by creating some additional "Understand" lines that will accept variant versions of the player's input.
current channel | output |
0 | "The screen of [the noun] is completely black." |
And we add the scenario-specific content to our Table of Television Channels; in the case of channel 13, we provide for a changing sequence of events using text variations.
current channel | output |
4 | "A gloomy female news anchor describes the latest car bomb in Baghdad: 104 dead today, and no sign of change." |
5 | "A couple of contestants in spangled scarlet outfits are performing an energetic paso doble." |
13 | "[one of]On-screen, Ichiro is up to bat with one man on second and no outs.[or]Ichiro has singled to first and the other man is on third.[or]The next batter is in the middle of flying out.[or]Everything looks rosy until the men in black pull off a double-play and retire the side.[or]The channel has cut to a commercial.[stopping]" |
Test me with "test one / test two".
You can see a widescreen TV and a fifties TV here.
>(Testing.)
>[1] test one
(Testing.)
>[2] change channel of fifties tv to 4
You tune the fifties TV to channel 4.
>[3] x channel 4
The fifties TV is currently turned off.
>[4] switch on fifties
You switch the fifties TV on.
>[5] x channel 4
A gloomy female news anchor describes the latest car bomb in Baghdad: 104 dead today, and no sign of change.
>[6] switch on widescreen
You switch the widescreen TV on.
>[7] tune fifties tv to channel 5
You tune the fifties TV to channel 5.
>[8] x channel 5
A couple of contestants in spangled scarlet outfits are performing an energetic paso doble.
>[9] x fifties tv
A couple of contestants in spangled scarlet outfits are performing an energetic paso doble.
>[10] x channel 4
You can't see any such thing.
>[11] test two
(Testing.)
>[12] tune to channel 13
What do you want to tune to that on?
>[13] widescreen
You tune the widescreen TV to channel 13.
>[14] tune channel 13 to channel 5
You tune the widescreen TV to channel 5.
>[15] tune channel 5 to channel 3
Which do you mean, the widescreen TV or the fifties TV?
>[16] widescreen
You tune the widescreen TV to channel 3.
>[17] x channel 3
Snow fills the screen of the widescreen TV.