Nautical bell: Difference between revisions

→‎{{header|AppleScript}}: Add implementation.
(→‎{{header|AppleScript}}: Add implementation.)
Line 8:
;Cf.:
* [[Sleep]]
 
=={{header|AppleScript}}==
This version uses local time and speaks the bell rings using the `say` command.
 
<lang applescript>repeat
set {hours:h, minutes:m} to (current date)
if {0, 30} contains m then
set bells to (h mod 4) * 2 + (m div 30)
set pairs to bells div 2
repeat pairs times
do shell script "say -v Bells 'ding dong'"
end repeat
if (bells mod 2) is 1 then
do shell script "say -v Bells 'dong'"
end if
end if
delay 60
end repeat</lang>
 
=={{header|C++}}==
1,480

edits