Informatique

Question

Bonjour, j'ai un devoir a faire en SNT sur EDUPYTHON .Je dois faire le drapeau de la suède. J'arrive très bien a mettre les couleur du drapeau etc... mais je bloque pour faire la croix jaune du drapeau de la suède.

Pourriez vous m'aidez a finir mon programme

1 Réponse

  • 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 :

Autres questions