Browse Source

deuxième tentative de la fonction spawn_rectangle mais ratée

master
ROBINET Julien 4 weeks ago
parent
commit
1d03ecddc6
  1. 11
      projet_tkinter_sujet5.py

11
projet_tkinter_sujet5.py

@ -14,6 +14,15 @@ if indice_couleur == 3 :
if indice_couleur == 4 :
couleur = "grey"
#taille = randint(10, 30)#
#position_x = randint(0, 400)#
#position_y = randint(0, 300)#
#while position_x+taille > 400 or position_y+taille > 300:#
# taille = randint(10, 31)#
# position_x = randint(0, 400)#
# position_y = randint(0, 300)#
def spawn_rectangle() :
taille = randint(10, 30)
position_x = randint(0, 400)
position_y = randint(0, 300)
@ -21,8 +30,6 @@ while position_x+taille > 400 or position_y+taille > 300:
taille = randint(10, 31)
position_x = randint(0, 400)
position_y = randint(0, 300)
def spawn_rectangle() :
rectangle = canva.create_rectangle(position_x, position_y, position_x+taille,
position_y+taille, fill = couleur)

Loading…
Cancel
Save