Skip to content

Commit 3f4056f

Browse files
author
arnaud
committed
aleatoire
1 parent 5e4f512 commit 3f4056f

6 files changed

Lines changed: 7 additions & 10 deletions

File tree

aleatoire/aleatoire.pdf

-733 Bytes
Binary file not shown.

aleatoire/aleatoire.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@
321321
x0 = x0 + dx # Nouvelle abscisse
322322
y0 = y0 + dy # Nouvelle ordonnée
323323

324+
canvas.coords(rect,x0,y0,x0+20,y0+20) # Déplacement
325+
324326
if x0 < 0 or x0 > Largeur:
325327
dx = -dx # Changement de sens horizontal
326328
if y0 < 0 or y0 > Hauteur:
327329
dy = -dy # Changement de sens vertical
328330

329-
canvas.coords(rect,x0,y0,x0+20,y0+20) # Nouveau rectangle
330-
331331
canvas.after(50,deplacer) # Appel après 50 millisecondes
332332

333333
return
@@ -337,7 +337,6 @@
337337
deplacer()
338338
return
339339

340-
341340
# Boutons
342341
bouton_couleur = Button(root,text="Déplacer", width=20, command=action_deplacer)
343342
bouton_couleur.pack(pady=10)

aleatoire/aleatoire_vertical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
##############################
3-
# Aléatoire - Idées
3+
# Aléatoire
44
##############################
55

66
from random import *

aleatoire/tkinter_mouvement.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ def deplacer():
2727
x0 = x0 + dx # Nouvelle abscisse
2828
y0 = y0 + dy # Nouvelle ordonnée
2929

30+
canvas.coords(rect,x0,y0,x0+20,y0+20) # Déplacement
31+
3032
if x0 < 0 or x0 > Largeur:
3133
dx = -dx # Changement de sens horizontal
3234
if y0 < 0 or y0 > Hauteur:
3335
dy = -dy # Changement de sens vertical
3436

35-
canvas.coords(rect,x0,y0,x0+20,y0+20) # Nouveau rectangle
36-
3737
canvas.after(50,deplacer) # Appel après 50 millisecondes
3838

3939
return
@@ -43,7 +43,6 @@ def action_deplacer():
4343
deplacer()
4444
return
4545

46-
4746
# Boutons
4847
bouton_couleur = Button(root,text="Déplacer", width=20, command=action_deplacer)
4948
bouton_couleur.pack(pady=10)

guide/guide-fonctions.pdf

-23 Bytes
Binary file not shown.

guide/guide-fonctions.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,13 @@ \subsection{Mouvement}
991991
x0 = x0 + dx # Nouvelle abscisse
992992
y0 = y0 + dy # Nouvelle ordonnée
993993
994+
canvas.coords(rect,x0,y0,x0+20,y0+20) # Déplacement
995+
994996
if x0 < 0 or x0 > Largeur:
995997
dx = -dx # Changement de sens horizontal
996998
if y0 < 0 or y0 > Hauteur:
997999
dy = -dy # Changement de sens vertical
9981000
999-
canvas.coords(rect,x0,y0,x0+20,y0+20) # Nouveau rectangle
1000-
10011001
canvas.after(50,deplacer) # Appel après 50 millisecondes
10021002
10031003
return
@@ -1007,7 +1007,6 @@ \subsection{Mouvement}
10071007
deplacer()
10081008
return
10091009
1010-
10111010
# Boutons
10121011
bouton_couleur = Button(root,text="Déplacer", width=20, command=action_deplacer)
10131012
bouton_couleur.pack(pady=10)

0 commit comments

Comments
 (0)