Nautical bell: Difference between revisions

→‎{{header|D}}: add stop method; more extensive output
(→‎{{header|REXX}}: clarified the REXX program description (in the section header). -- ~~~~)
(→‎{{header|D}}: add stop method; more extensive output)
Line 16:
 
class NauticalBell : Thread {
private bool stopped;
 
this () {
Line 34 ⟶ 35:
setNextBellTime();
 
while (true!this.stopped) {
time = cast(TimeOfDay)Clock.currTime();
if (next.minute == time.minute &&
Line 45 ⟶ 46:
yield();
}
}
void stop() {
this.stopped = true;
}
}
Line 55 ⟶ 60:
{{out}}
<pre>
2209:0030:00 : 43 bells
2210:3000:00 : 54 bells
2310:0030:00 : 65 bells</pre>
11:00:00 : 6 bells
11:30:00 : 7 bells
12:00:00 : 8 bells
12:30:00 : 1 bell</pre>
 
=={{header|REXX}}==
Anonymous user