QASIC PROGRAM TO MAKE CLOCK
REM Clock
SCREEN 7
CLS
start:
SCREEN 7
_FONT 16
LOCATE 1, 5
PRINT "CLOCK"
PRINT "________________________________________"
LINE (50, 50)-(100, 100), 1, BF
LOCATE 9, 5
PRINT "TIME"
LOCATE 10, 5
PRINT "CONTROL"
LINE (150, 50)-(200, 100), 2, BF
LOCATE 9, 18.5
PRINT "STOP WATCH"
DO
exit$ = INKEY$
IF exit$ = "e" OR exit$ = "E" THEN
CLS
SCREEN 7
COLOR 2, 1
LOCATE 5, 5
PRINT "YOU HAVE ABORTED THE CLOCK"
WHILE close_count <> 10
close_count = close_count + 1
LOCATE 7, 5
PRINT "APPLICATION ";
IF close_count MOD 2 = 1 THEN
PRINT "CLOSING >>> "
ELSE
PRINT "CLOSING >>> "
END IF
SLEEP 1
WEND
CLS
SCREEN 7
COLOR 10, 0
END
END IF
Mouser mx, my, mb
IF mb THEN
IF mx >= 50 AND my >= 50 AND mx <= 100 AND my <= 100 THEN 'button down
DO WHILE mb 'wait for button release
Mouser mx, my, mb
LOOP
'verify mouse still in box area
IF mx >= 50 AND my >= 50 AND mx <= 100 AND my <= 100 THEN
GOTO proccess
END IF
END IF
END IF
Mouser mx, my, mb
IF mb THEN
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN 'button down
DO WHILE mb 'wait for button release
Mouser mx, my, mb
LOOP
'verify mouse still in box area
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN
time_control = 1
GOTO proccess
END IF
END IF
END IF
LOOP
proccess:
IF time_control = 0 THEN
time_enter:
LOCATE 12, 6
INPUT "enter time"; t
IF t > 1800 THEN
mistake = mistake + 1
IF mistake > 3 THEN
PRINT "BLOCKED"
END
END IF
GOTO time_enter
END IF
END IF
Mouser mx, my, mb
IF mb THEN
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN 'button down
DO WHILE mb 'wait for button release
Mouser mx, my, mb
LOOP
'verify mouse still in box area
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN
time_control = 1
GOTO proccess
END IF
END IF
END IF
WHILE INKEY$ <> " "
SLEEP 1
count = count + 1
tc = tc + 1
BEEP
CLS
LOCATE 1, 5
PRINT "CLOCK"
PRINT "________________________________________"
IF time_control = 1 THEN
LINE (150, 50)-(200, 100), 2, BF
END IF
LOCATE 3, 5
PRINT "CURRENT TIME:"; TIME$
LOCATE 5, 5
PRINT "MINUTES:"; minute
LOCATE 6, 5
PRINT "SECONDS:"; count
IF count = 60 THEN
count = 0
minute = minute + 1
END IF
IF time_control = 0 THEN
LOCATE 8, 5
PRINT "TIME LEFT:"; (t - tc) \ 60; ":"; (t - tc) MOD 60
IF tc = t THEN
BEEP
BEEP
BEEP
BEEP
END
END IF
END IF
IF time_control = 1 THEN
Mouser mx, my, mb
IF mb THEN
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN 'button down
DO WHILE mb 'wait for button release
Mouser mx, my, mb
LOOP
'verify mouse still in box area
IF mx >= 150 AND my >= 50 AND mx <= 200 AND my <= 100 THEN
END
END IF
END IF
END IF
LOCATE 10, 10
PRINT "PRESS BUTTON TO END"
END IF
WEND
GOTO start
SUB Mouser (x, y, b)
mi = _MOUSEINPUT
b = _MOUSEBUTTON(1)
x = _MOUSEX
y = _MOUSEY
END SUB
0 Comments