Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Summary

In this lesson, you learned that:

  • The not block turns a condition around: not bone here is true where there's no bone, and false where there is one. This is called negation. not fits into every hexagonal slot, of a loop or of an If, and it counts as a block.
  • Repeat while not … repeats its blocks until the condition inside not becomes true. With Move forward inside, it walks the dog until it finds something: the next bone (not bone here) or the first opening on its right (not path to the right). With a turn inside, Repeat while not path ahead turns the dog until it faces the path.
  • Repeat until at the goal is such a loop too: it repeats its blocks while the dog is not at the goal. That's how a programmer writes it in Python or JavaScript.
  • Loops one under another split a walk into parts. Each loop ends where its part ends, and the next one goes on from there. That's how the dog told the first bone from the second.
  • Repeat while checks its condition before every pass, the first one too. When the condition is false from the start, the loop makes no pass at all.
  • An If in a loop asks again on every pass. When the dog should stop at the first of several places, use a loop with not.
  • A missing or extra not makes a loop do the opposite of what it should. The program may stop only at a later block, so look for the mistake above it too.

Time to practice it all together. The dog starts in a dead end again, and a bone lies on the path out. Where the bone lies, a side path leads off to the right, to the goal.

In the next lesson, Checkpoint: The Obstacle Course, you'll put everything you've learned so far together in a small project: the dog runs an obstacle course at a dog show.

Instructions

  1. 1

    On all three maps, get the dog out of the dead end, walk to the bone and pick it up.

  2. 2

    Then turn right and walk to the goal.

  3. 3

    Use at most 13 blocks.

Back

7/7

  1. 1. The Not Block
  2. 2. Turn Until the Path Is Ahead
  3. 3. Quiz: Repeat While Not
  4. 4. Bones Mark the Way
  5. 5. Take the First Right
  6. 6. Quiz: A Bug with Not
  7. 7. Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.