Женьку

 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
uses
graph, crt;
const
N=50;
type
romb = object
cx, cy,
color, size: byte;
procedure draw(x, y, c, s: byte);
procedure chcolor(c: byte);
procedure chsize(s: byte);
end;
procedure romb.draw;
begin
setcolor(c);
line(x-s, y, x, y+s*2); line(x+s, y, x, y+s*2);
line(x-s, y, x, y-s*2); line(x+s, y, x, y-s*2);
cx:=x; cy:=y; color:=c; size:=s;
end;
procedure romb.chcolor;
begin
romb.draw(cx, cy, c, size);
color:=c;
end;
procedure romb.chsize;
begin
romb.draw(cx, cy, color, s);
size:=s;
end;
var
i, x, y, c, s: byte;
d, r: integer;
lala: array [1..N] of romb;
BEGIN
randomize;
d:=detect;
initgraph(d, r, 'c:\tp\bgi');
for i:=1 to N do
lala[i].draw(random(getmaxX),
random(getmaxY),
random(getmaxcolor),
random(20));
repeat
delay(350);
i:=random(N)+1;
lala[i].chsize(random(20));
lala[i].chcolor(random(getmaxcolor));
until keypressed;
END.