1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-07 17:44:22 +03:00
inform7/resources/Documentation/Examples/SituationRoom.txt
2023-07-24 11:56:58 +01:00

24 lines
806 B
Plaintext

Example: * Situation Room
Location: Telling the time
RecipeLocation: The Passage Of Time
Index: Time told in 24-hour military style
Description: Printing the time of day in 24-hour time, as in military situations.
For: Z-Machine
Though Inform normally prints times in AM/PM terms, it stores the hours and minutes as 24-hour time; so, if we like, we can easily extract that information again thus:
{*}"Situation Room"
The Situation Room is a room.
To say (relevant time - a time) as 24h time:
let H be the hours part of relevant time;
let M be the minutes part of relevant time;
say "[if H is less than 10]0[end if][H][if M is less than 10]0[end if][M]".
When play begins:
now the time of day is 6:09 PM;
now the right hand status line is "[time of day as 24h time]".
Test me with "z".