def rectanglesOverlap( ax1: int, ay1: int, aw: float, ah: float, bx1: int, by1: int, bw: float, bh: float ) -> bool: """Check if two rectangles overlap.""" ax2 = ax1 + aw ay2 = ay1 + ah bx2 = bx1 + bw by2 = by1 + bh return (ax1 <= bx2 and ax2 >= bx1) and (ay1 <= by2 and ay2 >= by1) print("Testing rectanglesOverlap()...", end="") # Intersect at right of rectangle 1 assert rectanglesOverlap(1, 1, 5, 1, 6, 1, 2, 2) == True # Intersect at top of rectangle 1 assert rectanglesOverlap(1, 4, 5, 3, 1, 5, 8, 3) == True # Intersect at left of rectangle 1 assert rectanglesOverlap(1, 5, 6, 6, -4, 7, 5, 3) == True # Intersect at bottom of rectanagle 1 assert rectanglesOverlap(10, 10, 3, 3, 9, 7, 3, 3) == True # Partially overlapping rectangles assert rectanglesOverlap(1, 7, 3, 6, 3, 4, 2, 5) == True # Don't intersect assert rectanglesOverlap(1, 4, 3, 3, 10, 10, 5, 5) == False # Don't intersect, but x-coordinates overlap assert rectanglesOverlap(1, 4, 30, 3, 10, 10, 5, 5) == False # Don't intersect, but y-coordinates overlap assert rectanglesOverlap(1, 4, 3, 15, 10, 10, 5, 5) == False print("Passed!")