Tyl Programming Language
▶ ALARM SERVICE
Alarm Service is an executable program that implements an alarm clock.
Title:    Alarm Service
Version:  1.0
Date:     2019-11-10
Author:   Noam Y.


Overview
The alarm watch is set to raise the alarm on preset hour and minute.

Implementation
The program translates hour and minute data to alarm time in seconds. There are two watchers: current day watcher, new day watcher. Each watcher is responsible to compare the current time to the alarm time and raise the alarm.
The program has the option to raise the alarm almost immediatly, for debugging.

Action
The program first decides which watcher to use based on the current time vs. alarm time. If the new day watcher is selected, it watches for the passing date event, and activates the current day watcher, until eventually the alarm is raised.

Files