BSD 1 development
[unix-history] / tests / t03.p
CommitLineData
fde98a2d
BJ
1program graph2(output);
2const
3 d = 0.0625;
4 s = 32;
5 h1 = 34;
6 h2 = 68;
7 c = 6.28318;
8 lim = 32;
9var
10 i,j,k,n: integer;
11 x,y: real;
12 a: array[1..h2] of char;
13begin
14 for j := 1 to h2 do
15 a[j] := ' ';
16 for i := 0 to lim do
17 begin
18 x := d*i;
19 y := exp(-x)*sin(c*x);
20 a[h1] := ':';
21 n := round(s*y) + h1;
22 a[n] := '*';
23 if n < h1 then
24 k := h1 else
25 k := n;
26 for j := 1 to k do
27 write(a[j]);
28 writeln;
29 a[n] := ' ';
30 end
31end.