Sagot :
Réponse :
from kandinsky import *
def rect(x,y,L,r,v,b):
c=color(r,v,b)
for i in range(L):
for j in range (2*L):
set_pixel(x+i,y+j,c)
def rect2(x,y,L,r,v,b):
c=color(r,v,b)
for i in range(3*L):
for j in range (2*L//3):
set_pixel(x+i,y+j,c)
def drapeau_F(x,y,L):
rect(x,y,L,255,0,0)
x+=L
rect(x,y,L,255,255,255)
x+=L
rect(x,y,L,0,0,255)
c=color(0,0,0)
x-=2*L
y+=2*L
for i in range(4*L):
for j in range(-1,1):
set_pixel(x+j,y+i,c)
def drapeau_A(x,y,L):
rect2(x,y,L,0,0,0)
y+=2*L//3
rect2(x,y,L,255,0,0)
y+=2*L//3
rect2(x,y,L,255,204,0)
c=color(0,0,0)
y+=2*L//3
for i in range(4*L):
for j in range(-1,1):
set_pixel(x+j,y+i,c)
Explications :