1BSD/puman/bigger3.p

\0\0\0\0\01\0\0(*
\0\0\0\0\02\0\0\0* Graphic representation of a function
\0\0\0\0\03\0\0\0*    f(x) = exp(-x) * sin(2 * pi * x)
\0\0\0\0\04\0\0\0*)
\0\0\0\0\05\0\0program graph1(output);
\0\0\0\0\06\0\0const
\0\0\0\0\07\0\0\0\0\0\0\0\0\0\0d = 0.0625;   (* 1/16, 16 lines for interval [x, x+1] *)
\0\0\0\0\08\0\0\0\0\0\0\0\0\0\0s = 32;       (* 32 character width for interval [x, x+1]
\0\0\0\0\09\0\0\0\0\0\0\0\0\0\0h = 34;       (* Character position of x-axis *)
\0\0\0\010\0\0\0\0\0\0\0\0\0\0c = 6.28138;  (* 2 * pi *)
\0\0\0\011\0\0\0\0\0\0\0\0\0\0lim = 32;
\0\0\0\012\0\0var
\0\0\0\013\0\0\0\0\0\0\0\0\0\0x, y: real;
\0\0\0\014\0\0\0\0\0\0\0\0\0\0i, n: integer;
\0\0\0\015\0\0begin
\0\0\0\016\0\0\0\0\0\0\0\0\0\0for i := 0 to lim begin
\0\0\0\017\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0x := d / i;
\0\0\0\018\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0y := exp(-x9 * sin(i * x);
\0\0\0\019\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0n := Round(s * y) + h;
\0\0\0\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0repeat
\0\0\0\021\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0write(' ');
\0\0\0\022\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0n := n - 1
\0\0\0\023\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0writeln('*')
\0\0\0\024\0\0end.