' Program MandelbrotX2.bas

BackColor 30

ForeColor 33

CLS

R% = 10: Mx% = 430: My% = 430

INPUT"numero cicli (255) ",numits%

INPUT"a = (1.708), b = (-.064), c = (1.836), d = (.064) ", a, b, c, d

INPUT "Numero file", file%

CLS

OPEN "O",#1,"Mandelbrot."+STR$(file%)

PRINT #1,STR$(Mx%)+" "+STR$(My%)

PRINT#1,STR$(numits%)+" 0"

FOR K%=1 TO Mx%

PRINT#1, STR$(K%)+" ";

IF K%=Mx% THEN PRINT #1,""

NEXT K%

FOR K%=1 TO My%

PRINT#1, STR$(K%)+" ";

IF K%=My% THEN PRINT #1,""

NEXT K%

FOR p% = 1 TO Mx%

FOR q% = 1 TO My%

K=a+(c-a)*(p%+q%)/(2*Mx%): L=b+(d-b)*p%/My%

x =0: y=0: w%=200

FOR n%=1 TO numits%

xx=x^2-y^2-K

yy=2*x*y-L

x=xx: y=yy

IF x^2+y^2 > R% THEN

w%=n%:n%=numits%

END IF

NEXT n%

PRINT #1, STR$(w%)

NEXT q%,p%

CLOSE#1

LOCATE 1,1: INPUT Z

esc:

END