; SPIRO
; PART 1
2 TO J
8 TO RANDOM
180 TO C
IF X>127 -180 TO C
HTURN
0 TO B TO SPEEDY
C TO A TO SPEEDX
I+1 TO I
HORIZ
180 TO C
IF Y>127 -180 TO C
HSCAN
0-A/2+180+J TO AIM
AIM TO RADAR
0 - RADAR TO SHOT
IF RADAR<60 GOTO VTURN
IF RANDOM=0 GOTO VTURN
0-J TO J
IF SPEEDX=0 GOTO VTURN
GOTO HSCAN
VTURN
0 TO A TO SPEEDX
C TO B TO SPEEDY
IF I=6 GOTO SPIRO
VERT
180 TO C
IF X>127 -180 TO C
VSCAN
B/2+90+J TO AIM
AIM TO RADAR
0-RADAR TO SHOT
IF RADAR<60 GOTO HTURN
IF RANDOM=0 GOTO HTURN
0-J TO J
IF SPEEDY=0 GOTO HTURN
GOTO VSCAN
; PART 2
SPIRO
80 TO H TO V
IF X>127 176 TO H
IF Y>127 GOTO SETUP
GOTO DOWN
SETUP
176 TO V
GOTO UP
MOVE
H-X+50*2 TO SPEEDX
V-Y+50*2 TO SPEEDY
GOSUB SCAN
H-X-50*2 TO SPEEDX
V-Y-50*2 TO SPEEDY
GOSUB SCAN
ENDSUB
DOWN
V+25 TO V
GOSUB MOVE
IF V>175 GOTO RIGHT
GOTO DOWN
RIGHT
H+25 TO H
GOSUB MOVE
IF H>175 GOTO UP
GOTO RIGHT
UP
V-25 TO V
GOSUB MOVE
IF V<81 GOTO LEFT
GOTO UP
LEFT
H-25 TO H
GOSUB MOVE
IF H<81 GOTO DOWN
GOTO LEFT
SCAN
AIM+25 TO AIM TO RADAR
20 -RADAR TO SHOT
AIM+25 TO AIM TO RADAR
20-RADAR TO SHOT
IF SPEEDY=0 ENDSUB
AIM+25 TO AIM TO RADAR
20-RADAR TO SHOT
AIM+25 TO AIM TO RADAR
20-RADAR TO SHOT
ENDSUB