import rectangles as rect print('vertical split of rectangle 0') rect.split_vertical(0, 6) rect.print_nice(0) rect.print_nice(1) # Should print: # vertical split of rectangle 0 # [Rectangle: k=0 x=0.00 y=0.00 w=6.00 h=10.00] # [Rectangle: k=1 x=6.00 y=0.00 w=4.00 h=10.00] print('horizontal split of rectangle 0') rect.split_horizontal(0, 4) rect.print_nice(0) rect.print_nice(1) rect.print_nice(2) # Should print: # horizontal split of rectangle 0 # [Rectangle: k=0 x=6.00 y=0.00 w=4.00 h=10.00] # [Rectangle: k=1 x=0.00 y=0.00 w=6.00 h=4.00] # [Rectangle: k=2 x=0.00 y=4.00 w=6.00 h=6.00] print('dual split of rectangle 2') rect.split_both(2, 2, 8) rect.print_nice(0) rect.print_nice(1) rect.print_nice(2) rect.print_nice(3) rect.print_nice(4) rect.print_nice(5) # Should print: # dual split of rectangle 2 # [Rectangle: k=0 x=6.00 y=0.00 w=4.00 h=10.00] # [Rectangle: k=1 x=0.00 y=0.00 w=6.00 h=4.00] # [Rectangle: k=2 x=0.00 y=4.00 w=2.00 h=4.00] # [Rectangle: k=3 x=0.00 y=8.00 w=2.00 h=2.00] # [Rectangle: k=4 x=2.00 y=8.00 w=4.00 h=2.00] # [Rectangle: k=5 x=2.00 y=4.00 w=4.00 h=4.00]