Classic Computer Magazine Archive PROGRAM LISTING: 89-08/HOP2.ACT


;
PROC DRAW_FRACTAL()
 BYTE ATTRACT=77
 ATTRACT=0
 IF Y>=0 THEN J=JC+ (Y RSH SCREEN_SIZE)
  ELSE J=JC- (-Y RSH SCREEN_SIZE)
 ENDIF
 IF X>=0 THEN XX=Y+((X RSH R1)+CX)
   IF J>0 AND J<191 THEN I=IC+(X RSH SCREEN_SIZE)
    IF I>0 AND I<319 THEN PLOT(I,J)
    ENDIF
   ENDIF
  ELSE XX=Y+((-X RSH R2)-CX)
   IF J>0 AND J<191 THEN I=IC-(-X RSH SCREEN_SIZE)  
    IF I>0 AND I<319 THEN PLOT(I,J)
    ENDIF
   ENDIF
 ENDIF
 Y=(CY-X) Z==+1 X=XX
 IF Z=0 THEN Y==-7
 ENDIF
 IF DEMOMODE=ON THEN COUNT==+1
  IF COUNT>15000 THEN KEY=DEMO
  ENDIF
 ENDIF
RETURN
;
PROC CHANGE_PARAMETERS()
 IF KEY=MENUKEY THEN MENU() INITIALIZE_PLOT() 
 ENDIF
 IF KEY=SPACEBAR THEN 
  IF DISPLAY=OFF THEN DISPLAY=ON
   ELSE DISPLAY=OFF
  ENDIF
  KEY=CLEAR RETURN
 ENDIF
 IF KEY=SAVE THEN SAVE_FRACTAL() RETURN
 ENDIF
 IF KEY=LOAD THEN LOAD_FRACTAL() NEW_PARAMETERS() RETURN
 ENDIF
 IF KEY=DEMO THEN DEMOMODE=ON NEW_PARAMETERS()
  ELSE DEMOMODE=OFF
 ENDIF
 IF KEY=CREATE THEN NEW_PARAMETERS()
 ENDIF
 IF KEY=LARGER AND SCREEN_SIZE>1 THEN SCREEN_SIZE==-1 
  IC=2*IC-162 JC=2*JC-96
 ENDIF
 IF KEY=SMALLER AND SCREEN_SIZE<8 THEN SCREEN_SIZE==+1
  IC=(162+IC)/2 JC=(96+JC)/2
 ENDIF
 IF KEY=LEFT THEN  IC==-10
 ENDIF
 IF KEY=RIGHT THEN IC==+10
 ENDIF
 IF KEY=UP THEN    JC==-10
 ENDIF
 IF KEY=DOWN THEN  JC==+10
 ENDIF
 ZERO(SCREEN,7680)
 X=0 Y=0 Z=0 COUNT=0
 KEY=CLEAR
RETURN
;
PROC HOPDEMO()
 SETUP()
 MENU()
 NEW_PARAMETERS()
 BEGIN
   WHILE KEY=CLEAR BEGIN
     DRAW_FRACTAL()
   ENDWHILE
 CHANGE_PARAMETERS()
 END
RETURN
;

Back to previous page