pascalabcnet/TestSuite/overloads8.pas

19 lines
269 B
ObjectPascal
Raw Permalink Normal View History

2018-08-06 13:54:40 +03:00
type Point = auto class
x,y: integer;
end;
var i := 1;
function RandomPoint: Point;
begin
Result := new Point(i, i);
Inc(i);
end;
var a: array of Point;
begin
a := ArrGen(10,i->RandomPoint);
assert(a.Min(p->p.x) = 1);
assert(a.Max(p->p.x) = 10);
end.