hnc-eduard/HNC/Excercises/Magic/main.py

32 lines
855 B
Python
Raw Normal View History

2023-07-03 22:57:22 +02:00
from Point import Point
from Rectangle import Rectangle
r0 = Rectangle(Point(10, 20), Point(20, 10))
r1 = Rectangle(Point(5, 15), Point(15, 5))
r2 = Rectangle(Point(15, 25), Point(25, 15))
r3 = Rectangle(Point(5, 25), Point(15, 15))
r4 = Rectangle(Point(15, 15), Point(25, 5))
r5 = Rectangle(Point(0, 15), Point(9, 5))
r6 = Rectangle(Point(21, 15), Point(25, 15))
r7 = Rectangle(Point(5, 9), Point(15, 0))
r8 = Rectangle(Point(5, 25), Point(15, 21))
# Эти четыре команды должны вывести True
print(r0.intersection(r1))
print(r0.intersection(r2))
print(r0.intersection(r3))
print(r0.intersection(r4))
# Эти четыре команды должны вывести False
print(r0.intersection(r5))
print(r0.intersection(r6))
print(r0.intersection(r7))
print(r0.intersection(r8))
print(r0.merge(r1))
print(r0.merge(r2))