-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesta.le
100 lines (90 loc) · 1.66 KB
/
testa.le
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{Mandel test program }
{To test this program, run it, and type '-2 -1.25 0.5 1.25' as input coordinates, and an }
{iteration count of about 40. It may take some time, but it will get there eventually }
begin
write('Recommended input:'); writeln;
write('-2 -1.25 0.5 1.25'); writeln;
write('40'); writeln; writeln;
write('Please enter (left,top),(right,bottom)');
writeln;
read(left);
read(top);
read(right);
read(bottom);
write('Please enter maximum iterations');
writeln;
read(count);
oleft := left;
{Ok, so we have got the image to do, now all we need to do is step in both}
{directions in bits, and print the values of each point }
dx := (right-left)/80.0;
dy := (bottom-top)/40.0;
repeat
begin
repeat
begin
i := 0.0;
px := 0.0;
py := 0.0;
flag := 1.0;
repeat
begin
i := i+1.0;
nx := 2.0*px*py + top;
py := py*py - px*px + left;
px := nx;
if px*px+py*py > 4.0
begin
flag := 0.0;
end;
if i>count
begin
flag := 0.0;
end;
end
until flag != 1.0;
if i>1.0
begin
if i>3.0
begin
if i>8.0
begin
if i>16.0
begin
if i>32.0
begin
write(' ');
end
else
begin
write('*');
end;
end
else
begin
write('&');
end;
end
else
begin
write('%');
end;
end
else
begin
write(':');
end;
end
else
begin
write('.');
end;
left := left + dx;
end
until left >= right;
writeln;
left := oleft; {restore the left value }
top := top + dy; {increment the top point}
end
until top >= bottom;
end