1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 16:44:21 +03:00
inform7/Documentation/Examples/Timekeeper.txt
2019-02-05 00:44:07 +00:00

28 lines
1.8 KiB
Plaintext

* Actions applying to kinds of value
(Clocks that can be SET TO any time; Tom's Midnight Garden)
A clock kind that can be set to any time using "the time understood"; may be turned on and off; and will advance itself only when running. Time on the face is also reported differently depending on whether the clock is analog or digital.
Time can also be understood as a token, and the time parsed will be recorded as "the time understood". So therefore, if we wish for clocks which may be set:
{*}"Tom's Midnight Garden"
A clock is a kind of device. A clock has a time called the current time. A clock can be analog or digital. The current time of a clock is usually 9:01 AM. The description of a clock is "It shows the time to be [if analog]about [the current time to the nearest five minutes in words][otherwise][the current time][end if]."
Understand "set [clock] to [time]" as setting it by time. Setting it by time is an action applying to one thing and one time.
Instead of setting a clock to something:
say "[The noun] can be set only to a time of day, such as 8:00 AM, or midnight."
Carry out setting a clock by time:
now the current time of the noun is the time understood.
Report setting a clock by time:
say "You set [the noun] to [time understood]."
Every turn:
repeat with item running through switched on clocks:
now the current time of the item is one minute after the current time of the item.
The Hall is a room. The grandfather clock is a fixed in place analog clock in the Hall. The travel clock is a switched on digital clock in the Hall. When play begins: now the right hand status line is "[time of day]".
Test me with "examine grandfather clock / set it to midnight / switch it on / wait / wait / wait / examine it / set travel clock to 4:12 / examine it".