mirror of
https://github.com/ganelson/inform.git
synced 2024-07-08 01:54:21 +03:00
20 lines
744 B
Plaintext
20 lines
744 B
Plaintext
* Telling the time
|
|
(Time told in 24-hour military style; Situation Room)
|
|
Printing the time of day in 24-hour time, as in military situations.
|
|
|
|
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". |