Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program New;
- var
- TBox1, TBox2: TBox;
- function DoBoxesOverlap(tb1, tb2: TBox): Boolean;
- begin
- Result := False;
- if (not (InRange(tb1.x1, tb2.x1, tb2.x2))) then
- if (not (InRange(tb1.x2, tb2.x1, tb2.x2))) then
- exit;
- if (not (InRange(tb1.y1, tb2.y1, tb2.y2))) then
- if (not (InRange(tb1.y2, tb2.y1, tb2.y2))) then
- exit;
- Result := True;
- end;
- begin
- Writeln('begin');
- TBox1 := IntToBox(0, 0, 20, 20);
- TBox2 := IntToBox(5, 5, 30, 30);
- if DoBoxesOverlap(TBox1, TBox2) then
- Writeln('Yes')
- else
- Writeln('No');
- Writeln('end');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement