DECLARE SUB delay (dl)

SCREEN 12
DEF FNR (aQ) = aQ * 3.14 / 180
 
 sp = 12
 ch = 219
 WS = 2
 hcent = 300
 vcent = 200
 r = 100
 SA = 0
 HT = 20
 c = 5
 SA = FNR(SA)
 EA = 360
 EA = FNR(EA)
 AI = 1
 AI = FNR(AI)

 TH = SA
 
10 INPUT "what do you want the delay to be (0 - 30000). "; dl
 
CLS ' clear the screen

 DO
 
  ke$ = INKEY$' read keyboard


   TH = TH + AI
  
   IF TH > (EA) THEN TH = SA
   
    X = r * COS(TH) * WS
   
    Y = r * SIN(TH) / 2
   
    H = (hcent) + X: X1 = hcent - X
  
    V = (vcent) + Y: Y1 = vcent - Y


    CIRCLE (H, V), 30, 6
     LINE (hcent, vcent)-(H, V), 2
     LINE (H, V)-(H, V - 60), 1
     
     
      CALL delay(dl) ' call delay
      

    CIRCLE (H1, V1), 30, 0
     LINE (hcent, vcent)-(H1, V1), 0
     LINE (H1, V1)-(H1, V1 - 60), 0

 Ae = 5
 Ae = FNR(Ae)
  
  
   TH2 = TH2 + Ae
 
   IF TH2 > (EA) THEN TH2 = SA
  
    XX = r * COS(TH2) * WS
  
    YY = r * SIN(TH2) / 2
  
    hh = (H): X1 = hcent - X
 
    vv = (V - 60): Y1 = vcent - Y


    XX = hh + XX
    YY = vv + YY + tyy

    LINE (hh, vv)-(XX, YY), 3
    LINE (h3, v3)-(X3, Y3), 0
    CIRCLE (XX, YY), 40, 4
    CIRCLE (X3, Y3), 40, 0
      LINE (H, V)-(XX, YY), 7

      LINE (H1, V1)-(X3, Y3), 0
       


    h3 = hh: v3 = vv
    X3 = XX: Y3 = YY
     H1 = H
     V1 = V



     LINE (0, 350)-(600, 450), 1, BF



         IF ke$ = "R" THEN 10
    
 LOOP UNTIL ke$ = CHR$(27)

SUB delay (dl)
REM this sub runs the delay

ct = 0

DO

ct = ct + 1

LOOP UNTIL ct >= (dl)


END SUB

