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.

Bonsoir besoins d'aide s'il-vous-plaît je pour l'exercice pourriez-vous s'il-vous-plaît m'aider merci infiniment. ​

Bonsoir Besoins Daide Silvousplaît Je Pour Lexercice Pourriezvous Silvousplaît Maider Merci Infiniment class=

Sagot :

Mozi

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.