8-Bit Software Online Conversion
Mandlebrot Set - Listing
10REM MANDELBROT set gernarator
20REM
30REM By
40REM
50REM Ian T. Roxborough.
60REM
70xm=0:ym=0:Mnew=256:C=2.5:A=0:SET%=1
:B=0:MODE2:*LOAD S.SCREEN
80VDU29,512;512;:VDU28,16,31,19,0:PRO
CAFTER:PROCget`abc:CLG:H=C/640:S%=64:INP
UT"Colour set(1/2)"SET%:PRINTSET%:PRINT'
" X= ";A," Y= ";B," M= ";C
90FORY%=-512TO512STEP4:FORX%=-512TO51
2STEP8:U=A+H*X%:V=B+H*Y%:N%=-1:X=0:Y=0:R
EPEATY2=Y*Y:X2=X*X:Y=2*X*Y+V:X=X2-Y2+U:N
%=N%+1:UNTILN%=S%ORX2+Y2>=4
100IF INKEY-1 THEN Y%=512:X%=512
110PRINTTAB(0,0);N%:
120IF SET%=1 THEN GCOL0,7-(LN(N%)/(LN(
2))MOD8)-1 ELSE GCOL0,8-N%/8
130MOVEX%,Y%:DRAWX%,Y%:NEXT:NEXT
140GOTO80
150END
160PROCsave(S$)
170DEF PROCAFTER
180PRINT"Save":PRINT"Zoom":PRINT"Rset"
:REPEAT
190REPEAT
200IF INKEY-82 THEN PROCSAVE
210IF INKEY-98 THEN ENDPROC
220IF INKEY-52 THEN RUN
230UNTIL FALSE
240ENDPROC
250DEF PROCsave($&700)
260LOCAL X%,Y%:Y%=7
270CALL &FFF7
280ENDPROC
290DEF PROCget`abc
300PROCmag
310REPEAT
320IF INKEY-26 AND xm>-512 THEN PROCma
g:xm=xm-12:PROCmag
330IF INKEY-122 AND xm<512 THEN PROCma
g:xm=xm+12:PROCmag
340IF INKEY-42 AND ym>-512 THEN PROCma
g:ym=ym-12:PROCmag
350IF INKEY-58 AND ym<512 THEN PROCmag
:ym=ym+12:PROCmag
360IF INKEY-106 AND Mnew<1024 THEN PRO
Cmag:Mnew=Mnew+12:PROCmag
370IF INKEY-90 AND Mnew>1 THEN PROCmag
:Mnew=Mnew-12:PROCmag
380UNTIL INKEY-99
390PROCmag
400A=((xm/640)*C)+A:B=(ym/512)*C+B
410C=(Mnew/1024)*C
420PRINTA B C:REPEATUNTILINKEY-99
430ENDPROC
440DEF PROCmag
450MOVE xm+(Mnew/2),ym-(Mnew/2):PLOT6,
xm-(Mnew/2),ym-(Mnew/2):PLOT6,xm-(Mnew/2
),ym+(Mnew/2):PLOT6,xm+(Mnew/2),ym+(Mnew
/2):PLOT 6,xm+(Mnew/2),ym-(Mnew/2)
460ENDPROC
470DEF PROCSAVE
480REPEAT
490INPUT"Filename:"n$
500ME%=0
510IF n$="S.SCR" or n$="s.scr" THEN ME
%=1
520UNTIL ME%<>1
530ME%=0
540IF n$="" THEN ENDPROC
550CLS
560PROCsave(n$)
570ENDPROC