ДОДЕЛАТЬ ОСТАЛЬНЫЕ СТОРОНА ПЕРПЯТСТВИЯ ДЛЯ КРУГА
ПРОГРАММА ПАСКАЛЬ
ВОТ РАБОТА:
uses
GraphABC;
var
k:integer;
x,y, xp, yp:integer;
xc,yc: array[1..10] of integer ;
procedure roma2();
begin
brush.color := clgreen;
circle(x, y, 40);
brush.color := clwhite;
circle(x+15, y-10, 13);
circle(x-25, y-10, 13);
brush.color := clblack;
circle(x+15, y-10, 05);
circle(x-25, y-10, 05);
brush.color := clred;
circle(x-4, y+20, 15);
end;
procedure roma();
begin
for var i:=1 to 10 do
begin
if (x=xc[i])and(y=yc[i])
then begin
xc[i]:=450;
k:=k+1;
end;
brush.color := clwhite;
circle(xc[i],yc[i],40);
brush.color := clyellow;
circle(xc[i],yc[i],20);
end;
end;
//
procedure KeyDown(Key: integer);
begin
lockdrawing;
window.Clear;
case Key of
vk_left:
begin
if x<0
then x:=500
else x := x - 1;
end;
//
vk_right:
begin
if (x >=xp)and (y >= yp) and (y <= yp+100) and (x <= xp+100)
then x:=x
else if x > 500
then x:=0
else x := x + 1;
end;
//
vk_up:
begin
if y<0
then y:=500
else y := y - 1;
end;
vk_down:
begin
if y>500
then y:=0
else y := y + 1;
end;
end;
brush.Color:=clyellow;
rectangle(xp,yp,xp+100,yp+100);
TextOut(20,20,inttostr(k));
roma2;
roma;
redraw;
end;
begin
k:=0;
window.Height:=500;
window.Width:=500;
x:=200; y:=300;
xp:=300;
yp:=350;
brush.Color:=clyellow;
rectangle(xp,yp,xp+100,yp+100);
for var i:=1 to 10 do
begin
xc[i]:=random (400);
yc[i]:=random (400);
roma;
end;
roma2;
OnKeyDown := KeyDown;
end.