This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
2023-06-20 21:52:24 +03:00

28 lines
642 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Класс штампа прямоугольника с методами увеличения-уменьшения
uses GraphABC;
type
RectangleStamp = auto class
x,y,w,h: integer;
procedure Stamp := Rectangle(x,y,x+w,y+h);
procedure Increase(dw,dh: integer);
begin
w += dw; h += dh;
end;
procedure Decrease(dw,dh: integer) := Increase(-dw,-dh);
procedure MoveOn(dx,dy: integer);
begin
x += dx; y += dy;
end;
end;
begin
var r := new RectangleStamp(100,100,300,300);
r.Stamp;
while r.w>2 do
begin
r.Decrease(8,8);
r.MoveOn(4,4);
r.Stamp;
end;
end.