//PascalABC.NET 3.1 сборка 1200
uses GraphABC;
const
w = 30;
delay = 12;
begin
var k := Window.Width / Window.Height;
Brush.Color := clForestGreen;
for var i := 0 to Window.Height do
begin
var p := new System.Drawing.Point(round(k * i), i);
FillRectangle(p.X, p.Y, p.X + w, p.Y + w);
Sleep(delay);
Window.Clear(clYellowGreen);
end;
for var i := 0 to Window.Height do
begin
var p := new System.Drawing.Point(Window.Width - round(k * i), i);
FillRectangle(p.X - w, p.Y, p.X, p.Y + w);
Sleep(delay);
Window.Clear(clYellowGreen);
end;
end.