Recevez des conseils d'experts et un soutien communautaire sur Zoofast.fr. Obtenez des réponses détaillées et fiables de notre communauté d'experts qui sont toujours prêts à vous aider.
Sagot :
Bonsoir,
1) On considère que le robot est orienté dans le sens de la première ligne à 20 cm de l'endroit où il doit planter le premier haricot.
Avancer (pour se positionner dans le premier endroit où il doit planter)
Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter
Tourner à droite, Avancer, Tourner à Droite
Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter
Tourner à Gauche, Avancer, Tourner à Gauche
Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter
Tourner à droite, Avancer, Tourner à Droite
Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter, Avancer, Planter
Avancer (pour sortir du carré de jardinage)
2)
AV PH AV PH AV PH AV PH AV PH TD AV TD PH AV PH AV PH AV PH AV PH TG AV TG PH AV PH AV PH AV PH AV PH TD AV TD PH AV PH AV PH AV PH AV PH TG AV TG AV
En gras : script pour planter 5 haricots.
Souligné : Entrée et sortie du carré de jardinage.
Police normale : faire demi tour à droite et à gauche
3) Les instructions sont identiques. Elles correspondent à la partie en gras dans la question 1.
Si le langage de programmation le permet, on aurait pu créer une boucle au lieu de répéter les instructions.
Merci d'utiliser cette plateforme pour partager et apprendre. N'hésitez pas à poser des questions et à répondre. Nous apprécions chaque contribution que vous faites. Zoofast.fr est toujours là pour vous aider. Revenez souvent pour plus de réponses à toutes vos questions.