DECLARE SUB XPOD (X!, Y!, C!)
DECLARE SUB LN (H!, V!, X!, Y!, C!, BF!)
DECLARE SUB INTRO3 ()
DECLARE SUB INTRO2 ()
DECLARE SUB CIRC (H!, V!, RA!, C!)
DECLARE SUB SET (H!, V!, C!)
DECLARE SUB INTRO ()

WIDTH 80

SCREEN 0, 1, 1
WIDTH 80
CLS

 CH$ = CHR$(219)

V = 10: H = 10
C = 1
DO
KE$ = INKEY$
     SELECT CASE KE$

    CASE IS = "6", "K"
      H = H + 1
    CASE IS = "4", "J"
      H = H - 1
     CASE IS = "8", "I"
     V = V - 1
     CASE IS = "2", "M"
     V = V + 1
     CASE IS = "C"
     C = C + 1: IF C > 31 THEN C = 0
     COLOR C
     END SELECT
  
    
    RA = 5
   IF KE$ <> "" THEN
   CALL CIRC(H, V, RA, C)
   END IF
   LOCATE 1, 1:
   PRINT C, CH$;
     

   LOCATE 1, 1: PRINT C
   'LOCATE V, H: PRINT CH$;
   
   ' PSET (1, 1), C

   Y = 20: C = 2

  
   JH = STICK(0)
   
    X = JH
  
   CALL XPOD(X, Y, C)
  
   IF X <> (X1) OR Y <> (Y1) THEN
    CALL XPOD(X1, Y1, 0)
    X1 = X: Y1 = Y
   END IF
   LOOP UNTIL KE$ = CHR$(27)

SUB CIRC (H, V, RA, C)


    
 'RA  radius


 EA = 360' * 3.14 / 180

 AI = 1'.124444#  ' set speed of rotation



   'r = r + ai
 
 
   FOR R = 1 TO (96) STEP 10.5


    
    XH = RA * COS(R * 3.14 / 180) + 2.5


    CH = H + XH
    YV = RA * SIN(R * 3.14 / 180)
    CV = V + YV
   
    CHT = H - XH
    CVT = V - YV

CALL SET(CHT, CVT, C)
CALL SET(CH, CV, C)
CALL SET(CHT, CV, C)
CALL SET(CH, CVT, C)

 'H1 = H: V1 = V
 

   NEXT R

     CALL SET(H, V - RA, C)
     CALL SET(H, V + RA, C)



END SUB

SUB INTRO

CH$ = CHR$(219)

DO
 KE$ = INKEY$
CC = CC + 1
IF CC > 31 THEN CC = 0



  COLOR CC

PRINT CH$;
LOOP UNTIL KE$ = CHR$(32)

END SUB

SUB INTRO2


DO
KE$ = INKEY$
H = INT(RND(1) * (79)) + 1
V = INT(RND(1) * (23)) + 1
RA = INT(RND(1) * (20)) + 1
CALL CIRC(H, V, RA, C)
 C = INT(RND(1) * (31)) + 1

LOOP UNTIL KE$ = CHR$(27)


END SUB

SUB INTRO3
 DO
 KE$ = INKEY$
H = INT(RND(1) * (79)) + 1
V = INT(RND(1) * (22)) + 1
X = INT(RND(1) * (79)) + 1
Y = INT(RND(1) * (22)) + 1
 C = INT(RND(1) * (31)) + 1
 BF = 0
CALL LN(H, V, X, Y, C, BF)
 LOOP UNTIL KE$ = CHR$(27)

END SUB

SUB LN (H, V, X, Y, C, BF)

PX = H
PY = V
  IF X > (H) THEN L = X - H ELSE L = H - X
  IF Y > (V) THEN T = Y - V ELSE T = V - Y
XS1 = (L / 16)
YS1 = (T / 16)
DO
CALL SET(PX, PY, C)
IF X < (PX) THEN PX = PX - XS1
IF X > (PX) THEN PX = PX + XS1
IF Y > (PY) THEN PY = PY + YS1
IF Y < (PY) THEN PY = PY - YS1

LOOP UNTIL PX = X AND PY = Y

END SUB

SUB SET (H, V, C)
IF H >= 1 AND H <= 78 AND V >= 1 AND V <= 21 THEN
 LOCATE V, H
 PRINT CHR$(219);
COLOR C
END IF

END SUB

SUB XPOD (X, Y, C)
H = X
V = Y

CALL SET(H, V, C)
CALL SET(H - 1, V - 1, C)
CALL SET(H + 1, V - 1, C)
CALL SET(H + 1, V + 1, C)
CALL SET(H - 1, V + 1, C)

END SUB

