diff --git a/examples/ifs.pas b/examples/ifs.pas index bd227c7..1226962 100644 --- a/examples/ifs.pas +++ b/examples/ifs.pas @@ -82,7 +82,7 @@ begin pset(i, j); end; dpix := dpix div 2; - WriteLn('dpix = ', dpix); + Writeln('dpix = ', dpix); until button or (dpix < 1) end. \ No newline at end of file diff --git a/examples/julia.pas b/examples/julia.pas index 63b6df2..8f505ea 100644 --- a/examples/julia.pas +++ b/examples/julia.pas @@ -1,46 +1,50 @@ program ExampleJulia; -{Program to compute and plot Julia set.} - const scale = 0.01; R = 10; + type complex = record r: Real; i: real end; + var i, j, k, n, row, col, Nit: Integer; x, y: Real; z, znew, c: complex; done, gone: Boolean; + drawingRect: Rect; + procedure prod (a, b: complex; var c: complex); -{Does complex multiplication: c = a bullet b} begin c.r := a.r * b.r - a.i * b.i; c.i := a.r * b.i + a.i * b.r; end; + procedure add (a, b: complex; var c: complex); -{Does complex addition: c = a + b} begin c.r := a.r + b.r; c.i := a.i + b.i; end; + procedure plot (c, r: integer); -{Procedure to pixel (c.r).} begin Moveto(c, r); Lineto(c, r); end; + begin ShowText; - writeLn('How many iterations at each point?'); - readLn(Nit); - writeLn('Value of C: (Cr,Ci)?'); - ReadLn(c.r, c.i); - showdrawing; + Writeln('Value of Nit,Cr,Ci?'); + ReadLn(Nit, c.r, c.i); + + Showdrawing; + SetRect(drawingRect, 200, 40, 600, 400); + SetDrawingRect(drawingRect); + ForeColor(blackColor); n := 0; for col := 1 to 400 do @@ -59,5 +63,9 @@ begin plot(col, row); n := 0; end; - -end. \ No newline at end of file + +end. + +{ note: Interesting fractals } +{ 10 0 1 } +{ 50 0.3 -0.5 } \ No newline at end of file diff --git a/examples/pict.dialog.pas b/examples/pict.dialog.pas index 80ab6db..a2397a4 100644 --- a/examples/pict.dialog.pas +++ b/examples/pict.dialog.pas @@ -19,7 +19,7 @@ program ExampleDrawingExport; if err = noErr then Exit(CheckError); ShowText; - WriteLn('Error:', err); + Writeln('Error:', err); Cleanup; Halt; end; diff --git a/examples/pict.export.pas b/examples/pict.export.pas index b779578..e882704 100644 --- a/examples/pict.export.pas +++ b/examples/pict.export.pas @@ -21,7 +21,7 @@ program ExampleDrawingExport; if err = noErr then Exit(CheckError); ShowText; - WriteLn('Error:', err); + Writeln('Error:', err); Cleanup; Halt; end;