Πέμπτη 3 Νοεμβρίου 2022

Countdown Timer with light, sound and message


A simple program for a stopwatch or countdown timer. Sound made with Tone statement. Light made from 4hz tongle Light/Darg color using CLS (clear screen).
Module Timer {
Window 8, window
// choose one or none of them
//window 8, 18000, 14000;
//window 8, 12000, 8000;
Form 60
title "Timer"
cls #222222, 0
back {cls #222222, 0}
pen 14
pen 11 {Input "Set Timer (in minutes): ", N%}
if N%<=0 then Exit
pen #a2a252 {print "Press Space Bar to Quit"}
move scale.x/2, scale.y/2
z=scale.y/14850
pen #225544 {legend "Timer Enabled...", "ARIAL BLACK", 96*z,0,2}
Scroll Split Row
MM$="Beep"
z=scale.y/14850
mmt=floor(64*z)*2
r=row
Print over $(5),"Message: "; : Input ! MM$, 30 Len=30
if mm$="" then mm$="Beep"
select case len(mm$)
case <6
mmt=128*z
case 6 to 9
mmt=96*z
case 10 to 20
mmt=48*z
case else
mmt=mode*2
end select
cursor 0,row
a$=""
s$="Short Time"
refresh 2000
for i=1 to N% {
if i<N% then
a$=str$(N%-i,0)+" minute"+if$(N%-1=i->"","s")+" left"
else
a$=" some seconds left"
End if
k=0
every 1000 {
if k mod 2=1 then print Over else print Over $(6),a$
print Part $(0), str$(now,s$) : refresh 2000
k++:if k=60 then exit
if inkey$=" " then print :break
}
}
print
refresh 50
title "Timer Stop", 1
show
a=15
every 250 {
a=15-a
cls a
if a Then pen 12 {legend MM$, "ARIAL BLACK", mmt,0,2,0,200}
refresh
if inkey$=" " then exit
if a Then tone 1000, 200: show
}
cls 0x222222
print "done"
}
Timer


 

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

You can feel free to write any suggestion, or idea on the subject.