Segment reliant les 2 derniers clic
Maxime
-
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
J'ai beau chercher de midi à 14h mais je n'y arrive pas et c'est a rendre pour demain. Je suis en première spé NSI et je n'arrive pas à relier les deux derniers clic par un segment Quelsu'un pourrait m'aider svp???
Voici le programme:
from toolbox import *
## Rappel des touches :
## F5 ou F8 pour executer le programme
fenetre(801, 801, "TD1 - Exercice 5")
remplir(BLEUET)
##################################################
# Tapez votre code ci-dessous #
ecart = 100
p1 = Point(0, 0)
p2 = Point(801, 0)
rayon = 50
p_ = 0
liste_p = []
for i in range(8):
segment(p1, p2, ROUGE)
p1.y += ecart
p2.y += ecart
for i in range(6):
p_actuel = attendre_clic()
liste_p.append(p_actuel)
if i >= 2 and i <= 5:
p_actuel.y = (p_actuel.y // ecart) * 100 + rayon
cercle(p_actuel, rayon, ROUGE)
if i >= 3 and i <= 5:
cercle(p_, rayon, ROUGE)
p_ = p_actuel
# Fin de votre code #
#################################################
attendre_echap()
quitter(0)
J'ai beau chercher de midi à 14h mais je n'y arrive pas et c'est a rendre pour demain. Je suis en première spé NSI et je n'arrive pas à relier les deux derniers clic par un segment Quelsu'un pourrait m'aider svp???
Voici le programme:
from toolbox import *
## Rappel des touches :
## F5 ou F8 pour executer le programme
fenetre(801, 801, "TD1 - Exercice 5")
remplir(BLEUET)
##################################################
# Tapez votre code ci-dessous #
ecart = 100
p1 = Point(0, 0)
p2 = Point(801, 0)
rayon = 50
p_ = 0
liste_p = []
for i in range(8):
segment(p1, p2, ROUGE)
p1.y += ecart
p2.y += ecart
for i in range(6):
p_actuel = attendre_clic()
liste_p.append(p_actuel)
if i >= 2 and i <= 5:
p_actuel.y = (p_actuel.y // ecart) * 100 + rayon
cercle(p_actuel, rayon, ROUGE)
if i >= 3 and i <= 5:
cercle(p_, rayon, ROUGE)
p_ = p_actuel
# Fin de votre code #
#################################################
attendre_echap()
quitter(0)
A voir également:
- Segment reliant les 2 derniers clic
- Supercopier 2 - Télécharger - Gestion de fichiers
- 2 ecran pc - Guide
- Windows 11 clic droit afficher plus d'options par défaut - Guide
- Faire 2 colonnes sur word - Guide
- Whatsapp 2 - Guide
4 réponses
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonjour, peux-tu utiliser les balises de code, comme expliqué ici: https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
ok
from toolbox import *
## Rappel des touches :
## F5 ou F8 pour executer le programme
fenetre(801, 801, "TD1 - Exercice 5")
remplir(BLEUET)
##################################################
# Tapez votre code ci-dessous #
ecart = 100
p1 = Point(0, 0)
p2 = Point(801, 0)
rayon = 50
p_ = 0
liste_p = []
for i in range(8):
segment(p1, p2, ROUGE)
p1.y += ecart
p2.y += ecart
for i in range(6):
p_actuel = attendre_clic()
liste_p.append(p_actuel)
if i >= 2 and i <= 5:
p_actuel.y = (p_actuel.y // ecart) * 100 + rayon
cercle(p_actuel, rayon, ROUGE)
if i >= 3 and i <= 5:
cercle(p_, rayon, ROUGE)
p_ = p_actuel
# Fin de votre code #
#################################################
attendre_echap()
quitter(0)
qu'as-tu essayé?