DECLARE SUB GR ()
DECLARE SUB BOX (H!, V!, RT!, C!)
REM **********************************************
REM   More Qbasic Software at the Software Pages.
REM       http://www.euronet.nl/users/rkohm/
REM          Any questions? E-mail to:
REM              rkohm@euronet.nl
REM **********************************************

' A clock, made by Robin Ohm. 15-6-1996. If you have a question,
' please send an e-mail to rkohm@euronet.nl
' Please let me know what you think of the programme, thanks!!

COMMON SHARED H, V, H1, V1, R1, RT, DOW, RIG

SCREEN 12


'draws the clock.
CIRCLE (320, 240), 200, 15
CIRCLE (320, 440), 10, 15: DRAW "bup15,15bd5p15,15"
CIRCLE (320, 40), 10, 15: DRAW "bup15,15bd5p15,15"
CIRCLE (120, 240), 10, 15: DRAW "blp15,15br5p15,15"
CIRCLE (520, 240), 10, 15: DRAW "blp15,15br5p15,15"
DRAW "bm320,240TA30bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA60bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA120bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA150bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA210bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA240bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA300bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
DRAW "bm320,240TA330bu200": CIRCLE STEP(0, 0), 7, 15: DRAW "bu3p15,15bd6p15,15"
CIRCLE (320, 240), 10: PAINT (320, 240), 15
PAINT (1, 1), 1, 15: PAINT (300, 240), 8, 15

DO

DO                                  ' loop until the time changes
thetime$ = TIME$
hours = VAL(MID$(thetime$, 1, 2))
min = VAL(MID$(thetime$, 4, 2))
sec = VAL(MID$(thetime$, 7, 2))
LOOP UNTIL sec <> secold

'PLAY "l30 c"
'SOUND 100 + 2, .5

DRAW "TA-" + STR$(secold * 6) + "c8bm320,240d40u230"  ' redraw the hands in
IF min <> minold THEN                                 ' the background color.
 DRAW "TA-" + STR$(minold * 6) + "c8bm320,240d40u180h10e10u30d30f10g10"
 hourstmp = hoursold
 IF hoursold >= 12 THEN hourstmp = hoursold - 12
 DRAW "TA-" + STR$(CINT(30 * hourstmp + minold / 2)) + "c8bm320,240d40u150h10e10u20d20f10g10"
END IF

DRAW "TA-" + STR$(sec * 6) + "c4bm320,240d40u230"     ' draw the hands
DRAW "TA-" + STR$(min * 6) + "c14bm320,240d40u180h10e10u30d30f10g10"
hourstmp = hours
IF hours >= 12 THEN hourstmp = hours - 12
DRAW "TA-" + STR$(CINT(30 * hourstmp + min / 2)) + "c14bm320,240d40u150h10e10u20d20f10g10"

CIRCLE (320, 240), 10, 15: PAINT (320, 240), 15
hoursold = hours    ' you need these variables to redraw the hands in
minold = min        ' the background color.
secold = sec

CALL GR

LOOP UNTIL INKEY$ <> ""   ' loop until the user presses a key.

CLS
PRINT " returning to "
PRINT " 1 for basic "
PRINT " 2 for the Gui"
PRINT " 3 for third clock"
PRINT " 4 COCOROM"



INPUT N

PRINT " thank you"
PRINT " please wait ..."


IF N = 1 THEN RUN "qbmenu.bas"
IF N = 2 THEN RUN "qbwin01.bas"
IF N = 3 THEN RUN "clock3.bas"
IF N = 4 THEN RUN "COCOROM.BAS"
RUN "COCOROM.bas"

SUB BOX (H, V, RT, C)




 LINE (H + RT, V)-(H + 90, V + RT), C
  LINE -(H + 90 - RT, V + 90), C
   LINE -(H, V + 90 - RT), C
    LINE -(H + RT, V), C





END SUB

SUB GR


RT = RT + 1: IF RT > 90 THEN RT = 0

CALL BOX(H, V, RT, 1)

CALL BOX(H1, V1, R1, 0)

H1 = H
V1 = V

R1 = RT
                                             
IF RIG = 0 THEN H = H + SP: IF H > 620 THEN RIG = 1
IF RIG = 1 THEN H = H - SP: IF H < 0 THEN H = 0: RIG = 0
IF DOW = 0 THEN V = V + SP: IF V > 200 THEN DOW = 1
IF DOW = 1 THEN V = V - SP: IF V < 0 THEN V = 0: DOW = 0



END SUB

