Coding club : apprendre à programmer (6e)

Fiche à imprimer : le cours, les trois exercices et le corrigé (sur une page à part). Revenir au cours en ligne

AnglaisFrançais
to code / coding 💻coder, programmer / la programmation
a programun programme
a bug 🐞un bug, une erreur
a loop 🔁une boucle
if... then...si... alors...
to run the programlancer le programme

Programmer (to code), c'est donner des instructions très précises à un ordinateur. Beaucoup de mots de l'informatique viennent de l'anglais ! Une erreur s'appelle a bug (un insecte !) : en 1947, une vraie mite coincée dans un ordinateur avait provoqué une panne. Une boucle (a loop) répète des actions : Repeat 4 times: move forward, turn right. Une condition s'écrit if... then... : If you touch a wall, then turn left.

Mise en situation : au club de code

Mrs Khan : Today, let's program the robot to draw a square.
Aujourd'hui, programmons le robot pour qu'il dessine un carré.
Omar : Move forward ten steps, turn right. Then again and again?
Avancer de dix pas, tourner à droite. Et ensuite encore et encore ?
Mrs Khan : Use a loop! Repeat four times.
Utilise une boucle ! Répéter quatre fois.
Omar : OK. Now let's run the program... Oh no! It draws a triangle!
D'accord. Maintenant, lançons le programme... Oh non ! Il dessine un triangle !
Mrs Khan : There's a bug! Let's debug it. Check the angle.
Il y a un bug ! Corrigeons-le. Vérifie l'angle.
Omar : I wrote 120 degrees! It should be 90. Now it works!
J'ai écrit 120 degrés ! Ça devrait être 90. Maintenant ça marche !

À retenir

  • to code, a program, a bug, a loop, if... then..., to run, to debug.
  • Move forward! Turn right! Repeat four times! If..., then...!

Exercice 1 : La programmation : exercice 1 (QCM)

  1. « programmer »
    1. to coat
    2. to cod
    3. to code
  2. « une erreur (informatique) »
    1. a big
    2. a bag
    3. a bug
  3. « une boucle »
    1. a loop
    2. a loup
    3. a look
  4. « lancer le programme »
    1. to launch on program
    2. to run the program
    3. to race the program
  5. « corriger un bug »
    1. to debug
    2. to rebug
    3. to unbug
  6. « si... alors... »
    1. if... then...
    2. when... so...
    3. if... than...
  7. « Avance ! »
    1. Go front!
    2. Move forwards back!
    3. Move forward!
  8. Pour un carré, l'angle est de...
    1. 45 degrés
    2. 90 degrés
    3. 120 degrés
  9. D'où vient le mot « bug » ?
    1. une vraie mite coincée dans un ordinateur
    2. un jeu vidéo
    3. un robot
  10. « Répète quatre fois. »
    1. Repeat four time.
    2. Repeat for times.
    3. Repeat four times.

Exercice 2 : La programmation : exercice 2 (à compléter)

  1. Let's .......................... the robot.
  2. Move .......................... ten steps.
  3. Turn .......................... .
  4. Use a .......................... ! (boucle)
  5. Repeat four .......................... .
  6. Let's .......................... the program.
  7. There's a .......................... !
  8. Let's .......................... it.
  9. If you touch a wall, .......................... turn left.
  10. Now it .......................... !

Exercice 3 : La programmation : mise en situation

  1. Tu dis au robot d'avancer.
    1. Move forward!
    2. Moving forward!
    3. Move to front!
  2. Tu proposes une boucle.
    1. Use a look!
    2. Use a loop!
    3. Use loop a!
  3. Tu lances le programme.
    1. Let's running the program!
    2. Let's race the program!
    3. Let's run the program!
  4. Tu trouves une erreur.
    1. There are a bug!
    2. There's a bug!
    3. There's a bag!
  5. Tu proposes de corriger l'erreur.
    1. Let's debugging it!
    2. Let's unbug it!
    3. Let's debug it!
  6. Tu écris une condition.
    1. When you touch wall, so turn left.
    2. If you touch a wall, than turn left.
    3. If you touch a wall, then turn left.
  7. Tu dis que ça marche.
    1. It works!
    2. It walks!
    3. It work!
  8. Tu dis « Répète quatre fois ».
    1. Repeat four time.
    2. Repeat four times.
    3. Repeat for times.
  9. Tu dis que tu aimes programmer.
    1. I love coding!
    2. I loves coding!
    3. I love to codes!
  10. Tu demandes de vérifier l'angle.
    1. Check angle the!
    2. Check the angel!
    3. Check the angle!

Corrigé

Exercice 1

1. c) to code · 2. c) a bug · 3. a) a loop · 4. b) to run the program · 5. a) to debug · 6. a) if... then... · 7. c) Move forward! · 8. b) 90 degrés · 9. a) une vraie mite coincée dans un ordinateur · 10. c) Repeat four times.

Exercice 2

1. program · 2. forward · 3. right · 4. loop · 5. times · 6. run · 7. bug · 8. debug · 9. then · 10. works

Exercice 3

1. a) Move forward! · 2. b) Use a loop! · 3. c) Let's run the program! · 4. b) There's a bug! · 5. c) Let's debug it! · 6. c) If you touch a wall, then turn left. · 7. a) It works! · 8. b) Repeat four times. · 9. a) I love coding! · 10. c) Check the angle!