: get_time systime ctime dup " " rinstr 1 - strcut pop dup " " rinstr strcut swap pop dup ":" rinstr 1 - strcut pop ; : get_hour_name atoi dup dup 12 = swap 0 = or if pop "twelve" exit then dup dup 23 = swap 11 = or if pop "eleven" exit then dup dup 22 = swap 10 = or if pop "ten" exit then dup dup 21 = swap 9 = or if pop "nine" exit then dup dup 20 = swap 8 = or if pop "eight" exit then dup dup 19 = swap 7 = or if pop "seven" exit then dup dup 18 = swap 6 = or if pop "six" exit then dup dup 17 = swap 5 = or if pop "five" exit then dup dup 16 = swap 4 = or if pop "four" exit then dup dup 15 = swap 3 = or if pop "three" exit then dup dup 14 = swap 2 = or if pop "two" exit then dup dup 13 = swap 1 = or if pop "one" exit then pop "WTF?" ; : run_clock systime dup 900 / 900 * 900 + swap - 2 + sleep get_time ":" explode pop swap dup "15" strcmp not if pop "quarter past " then dup "30" strcmp not if pop "half past " then dup "00" strcmp not if pop "exactly " then dup "45" strcmp not if pop "quarter of " swap atoi 1 + dup 23 > if 24 - then intostr swap then over get_hour_name strcat "The clock chimes the time: " swap strcat swap atoi dup dup 0 >= swap 12 < and if swap " in the morning." strcat swap then dup dup 12 >= swap 18 < and if swap " in the afternoon." strcat swap then 18 > if " in the evening." strcat then " (PST)" strcat trigger @ location location #-1 rot notify_except run_clock ; : main pop run_clock ;