initial commit

This commit is contained in:
2026-03-25 07:13:37 +00:00
commit 8d643a3842
28 changed files with 790 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
def intersects?(rect1, rect2)
x1, y1, w1, h1 = rect1
x2, y2, w2, h2 = rect2
# No overlap conditions
return false if x1 + w1 <= x2 # rect1 is left of rect2
return false if x1 >= x2 + w2 # rect1 is right of rect2
return false if y1 + h1 <= y2 # rect1 is above rect2
return false if y1 >= y2 + h2 # rect1 is below rect2
true # overlap exists
end