{ For all of you who are interested on fractals, here is a little program, taken from a source code in Modula-2, that will draw a Mandelbrot fractal. Just one problem: If your computer doesn't have a math coprocessor, the program will run "a bit" slow :). Try modifying all the constants, you'll get strange results :).} {$U-} { Supposed to be used for Breaking During Programs } Program Mandelbrot; {Using real numbers. For TP 6.0 and above } Type Filestr = String[14]; Const Colours=15; {Number of colors to be on the image. } Width=640; {Width of the image. } Height=400; {Height of the image. } Limit=8.0; {Until when we calculate. } XRMin=-2.0; {Left limit of the fractal. } XRMax=1.0; {Right limit of the fractal. } YRMin=-1.3; {Lower limit of the fractal. } YRMax=1.3; {Upper limit of the fractal. } Bufsize = 128; Var XPos,YPos:Integer; Coldata : array[0..16000] of byte absolute $4000; Procedure Load(filename:Filestr); var recsread : integer; source : file; begin assign(source,filename); reset(source); repeat blockread(source,Coldata,bufsize,recsread); until recsread=0; close(source); end; Procedure mode(mo:byte); begin Inline($3A/mo/ $CD/$9B/$BE/ $0E/$BC); end; Procedure grapen(col:byte); begin Inline($3A/col/ $CD/$9B/$BE/ $DE/$BB); end; Procedure Plot(Xpos, Ypos : integer); begin Inline($2A/ypos/ $ED/$5B/xpos/ $CD/$9B/$BE/ $EA/$BB); end; Procedure drawblt(xpos2, ypos2, count, hlt : integer); begin repeat begin xpos2:=0; repeat begin grapen(Coldata[count]); plot(Xpos2, Ypos2); xpos2:=xpos2+2; count:=succ(count); end; until (xpos2=width); ypos2:=ypos2-2; end; until (ypos2=hlt); end; Begin mode(1); load('mandel1.dat'); drawblt(0,398,0,298); load('mandel2.dat'); drawblt(0,298,0,198); load('mandel3.dat'); drawblt(0,198,0,098); load('mandel4.dat'); drawblt(0,098,0,0); repeat until keypressed; mode(2); End.