poly = polygon([(0, 0), (0, 6), (6, 6), (6, 0)], color='blue', edgecolor='black', alpha=0.5, zorder=1)+polygon([(3, 3), (3, 8), (8, 8), (8, 3)], color='yellow', edgecolor='black', alpha=0.5, zorder=2)+ polygon([(4, 0), (4, 4), (8, 4), (8, 0)], color='green', edgecolor='black', alpha=0.5, zorder=3)+ polygon([(0, 5), (0,8), (3, 8), (3, 5)], color='magenta', edgecolor='black', alpha=0.5, zorder=4)+polygon([(0, 0), (0, 2), (2, 2), (2, 0)], color='red', edgecolor='black', alpha=0.5, zorder=5) + polygon([(0, 0), (0, 1), (1, 1), (1, 0)], color='white', edgecolor='black', alpha=0.5, zorder=6)
show(poly, xmin=-1, xmax=10, ymin=-1, ymax=10)
poly2 = polygon([(0, 0), (0, 2), (2, 2), (2, 0)], color='magenta', edgecolor='black', alpha=0.5, zorder=1) + polygon([(0, 0), (0, 1), (1, 1), (1, 0)], color='yellow', edgecolor='black', alpha=0.5, zorder=2)
show(poly2, xmin=0, xmax=3, ymin=0, ymax=3)
polygon([(0, 0), (0, 6), (6, 6), (6, 0)])
polygon([(0, 0), (0, 0), (0, 0), (0, 0)])
from kvadrati2 import Kvadrat2
Kvadrat2(1,1,1).narisi()
a = Kvadrat2(1,1,1)
b = Kvadrat2(2, 12, 19)
c = Kvadrat2(3, 1, 1)
d = Kvadrat2(4, 11, 15)
e = Kvadrat2(5, 1, 4)
f = Kvadrat2(6, 14, 14)
g = Kvadrat2(7,12,1)
h = Kvadrat2(8,11,7)
i = Kvadrat2(9,3,1)
j = Kvadrat2(10,1,9)
poly3 = a.narisi("purple")+b.narisi("yellow")+c.narisi("orange")+d.narisi("black")+e.narisi("green")+f.narisi("brown") + g.narisi("red") + h.narisi("pink") + i.narisi("blue") + j.narisi("green")
poly3 = poly3 + polygon([(0, 0), (0, 18), (18, 18), (18, 0)], color='black', edgecolor='black', fill=False, zorder=1)
poly3
aa = Kvadrat2(1, 9,9)
bb = Kvadrat2(2,9,7)
cc = Kvadrat2(3,6,7)
dd = Kvadrat2(4,1,1)
ee = Kvadrat2(5,1,5)
ff = Kvadrat2(6,5,1)
poly4 = aa.narisi("green") + bb.narisi("orange") + cc.narisi("pink") + dd.narisi("magenta") + ee.narisi("blue") + ff.narisi("purple")
poly4 = poly4 + polygon([(0, 0), (0, 9), (9, 9), (9, 0)], color='black', edgecolor='black', fill=False, zorder=1)
poly4
aa = Kvadrat2(1,2,5)
bb = Kvadrat2(2,6,5)
cc = Kvadrat2(3,1,1)
dd = Kvadrat2(4,4,1)
ee = Kvadrat2(5,1,2)
ff = Kvadrat2(6,1,1)
poly4 = aa.narisi("green") + bb.narisi("purple") + cc.narisi("pink") + dd.narisi("magenta") + ee.narisi("blue") + ff.narisi("yellow") + polygon([(0, 0), (0, 6), (6, 6), (6, 0)], color='black', edgecolor='black', fill=False, zorder=1)
poly4
a = Kvadrat2(1,8,8)
b = Kvadrat2(2, 8, 6)
c = Kvadrat2(3, 1, 1)
d = Kvadrat2(4,1,1)
e = Kvadrat2(5, 5, 1)
f = Kvadrat2(6, 4, 1)
g = Kvadrat2(7,1,3)
h = Kvadrat2(8,1,2)
i = Kvadrat2(9,1,1)
j = Kvadrat2(10,1,1)
poly3 = a.narisi("purple")+b.narisi("yellow")+c.narisi("orange")+d.narisi("black")+e.narisi("green")+f.narisi("brown") + g.narisi("red") + h.narisi("pink") + i.narisi("blue") + j.narisi("yellow")
poly3
poly3 = poly3 + polygon([(0, 0), (0, 8), (8, 8), (8, 0)], color='black', edgecolor='black', fill=False, zorder=1)
poly3