Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. bool doOverlap(Point l1, Point r1, Point l2, Point r2)
  2. {
  3.     // If one rectangle is on left side of other
  4.     if (l1.x > r2.x || l2.x > r1.x)
  5.         return false;
  6.  
  7.     // If one rectangle is above other
  8.     if (l1.y < r2.y || l2.y < r1.y)
  9.         return false;
  10.  
  11.     return true;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement