5 scnclr 10 n=0: nm=0: x=0: y=0: r=0: i=0: d=0: v=0: u=0: a=0: b=0: da=0: db=0 20 iu=0: io=0: ru=0: ro=0: f1=1: f2=1: f3=1: f4=1: xr=0: yi=0 30 a$="": b$="" 32 graphic clr 40 screen def 1,0,0,7 50 screen open 1 400 print "" 403 print "graphical representation of mandelbrot set" 404 print "(note: do not input multiple values together; press return after every value)" 410 print "" 412 print "parameters of the gaussian plane (normal -2, 0.5, -1.25, 1.25):": input"ru,ro,iu,io=";ru,ro,iu,io 420 print "" 421 print "complex variable (normal 0,0)": input"x,y=";xr,yi 450 nm=45 460 print "" 461 print "" 462 print "now this will take a while..even on c65! :-)" 470 sleep 1 480 screen set 1,1: scnclr 0 490 border 0 500 restore 510 for i=1 to 46 520 read a,b,c 530 palette 1,i,a,b,c 540 next i 550 da=ro-ru 551 da=da/159 552 db=io-iu 553 db=db/199 560 b=iu-db 570 for u=0 to 199 580 b=b+db 581 a=ru-da 590 for v=0 to 319 600 a=a+da 610 n=0 611 r=xr 612 i=yi 613 d=0 620 do while d<4 630 x=r: y=i 640 r=x*x 641 r1=y*y 642 r=r-r1 643 r=r+a 644 i=2*x 645 i=i*y 646 i=i+b 647 d=r*r 648 d1=i*i 649 d=d+d1 650 n=n+1 660 if n=nm then exit 670 loop 680 if n=nm then pen 0,0: line v,u,v,u: else pen 0,n+1: line v,u,v,u 690 next v 691 next u 700 get a$: if a$="" then goto 700 740 screen close 1 741 end 750 data 0,0,0,1,0,1,2,0,2,3,0,3,4,0,4,5,0,5,6,0,6,7,0,7,8,0,8,9,0,9 760 data 10,0,10,11,0,11,12,0,12,13,0,13,14,0,14,15,0,15,15,0,14 770 data 15,0,13,15,0,12,15,0,11,15,0,10,15,0,9,15,0,8,15,0,7,15,0,6 780 data 15,0,5,15,0,4,15,0,3,15,0,2,15,0,1,15,0,0,15,1,0,15,2,0,15,3,0 790 data 15,4,0,15,5,0,15,6,0,15,7,0,15,8,0,15,9,0,15,10,0,15,11,0 800 data 15,12,0,15,13,0,15,14,0,15,15,0