Hello,
I have a set of Control Panels. Each control panel has a button, a dial, and a light that are “part” of the control panel. Those are referenced as Control Panel One’s button, etc.
When i ask the parser to “X BUTTON” it presents a “Do you mean” that is appropriate. i.e. which of these six buttons (or dials or lights) do you mean. Working as expected.
However, when i ask “X PANEL” it prompts with a “Do you mean” with all 6 control panels, all six buttons, all six dials, and all six lights.
any thoughts?
d.
test me with "x button / x dial / x light / x panel".
Color is a kind of value. The colors are nondescript, aqua, crimson, emerald, gray, indigo, khaki, magenta, orange, and quartz.
Section 3 - Control Room
Control Room is a room. "This is the control room.".
Section 4 - Control Panels
A control panel is a kind of open container.
Understand "control/panel" as a control panel.
A control panel is scenery.
A control panel has a color. Understand the color property as describing a control panel.
A control panel has a number called a panel id. Understand the panel id property as describing a control panel.
The description of a control panel is "This is a control panel."
Control Panel One is a control panel in the Control Room. The panel id of Control Panel One is 1. The color of Control Panel One is aqua.
Control Panel Three is a control panel in the Control Room. The panel id of Control Panel Three is 3. The color of Control Panel Three is crimson.
Control Panel Five is a control panel in the Control Room. The panel id of Control Panel Five is 5. The color of Control Panel Five is emerald.
Control Panel Seven is a control panel in the Control Room. The panel id of Control Panel Seven is 7. The color of Control Panel Seven is gray.
Control Panel Nine is a control panel in the Control Room. The panel id of Control Panel Nine is 9. The color of Control Panel Nine is indigo.
Control Panel Eleven is a control panel in the Control Room. The panel id of Control Panel Eleven is 11. The color of Control Panel Eleven is khaki.
Definition: A thing is control-fitted if it is incorporated by a control panel.
[This will allow us to refer to the "corresponding" socket, switch, or indicator; i.e. the one from the same panel. This particular phrase works because there is only ever one each of these in a panel. If we decide later to have, say, three sockets per panel, only this phrase will have to be changed -- using more complex logic -- but the rest of the code could be left as-is.]
To decide what thing is --/the corresponding (name of kind of value K) of --/the (CT - a control-fitted thing):
let H be the holder of CT;
decide on a random K that is part of H.[<- there will only ever be one of these]
To decide what thing is --/the corresponding (name of kind of value K) of --/the (T - a thing):
decide on a random K that is part of T.[<- there will only ever be one of these]
[The following won't actually give all the panel's components a color property matching the panel, but it will allow us to refer to a "shared color" of these components and get the desired result.]
To decide what color is --/the shared color of --/a/the (CT - a control-fitted thing):
decide on the color of the holder of CT.
Section 5 - Buttons
T is text that varies. T is "".
when play begins:
repeat with b running through buttons:
now the printed name of b is "[an color of the holder of the item described] colored button";
A button is a kind of device. A button is part of every control panel (called its button).
A button is usually switched off.
A button is always fixed in place.
The description of a button is "This is the [a color of the holder of the item described] colored button.".
To decide what number is --/the button id of (B - a button):
decide on the panel id of the holder of B.
To decide what color is --/the color of (B - a button):
decide on the color of the holder of B.
Section 6 - Dials
T is text that varies. T is "".
when play begins:
repeat with d running through dials:
now the printed name of d is "[an color of the holder of the item described] colored dial";
A dial is a kind of thing. A dial is part of every control panel (called its dial).
Understand "knob" as dial.
A dial is fixed in place.
A dial has a number called a dial setting.
The description of a dial is "This is the [color of the holder of the item described] colored dial. It is currently set to [dial setting of the item described]. I bet you could SET it to a number.".
To decide if (D - a dial) is properly set:
if the panel id of the holder of D is the dial setting of D :
decide yes;
decide no.
To decide what number is --/the dial id of (D - a dial):
decide on the panel id of the holder of D.
To decide what color is --/the color of (D - a dial):
decide on the color of the holder of D.
To decide what number is --/the dial setting of (D - a dial):
decide on the dial setting of D.
Section 7 - Lights
T is text that varies. T is "".
when play begins:
repeat with l running through lights:
now the printed name of l is "[an color of the holder of the item described] colored light";
A light is a kind of thing. A light is part of every control panel (called its light).
A light is fixed in place.
The description of a light is "This is the [a printed name of the item described]. The light is [if the corresponding button of the item described is switched on]on[otherwise]off[end if]."
To decide what number is --/the socket id of (L - a light):
decide on the panel id of the holder of L.
To decide what color is --/the color of (L - a light):
decide on the color of the holder of L.