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

Bones in the Maze

The mazes have bones in them, even in dead ends. The editor holds the right-hand rule from the last exercise. Add to it so that the dog picks up all the bones on its way.

Programmers rarely write programs from scratch. They take a program that works and extend it with something new. What matters is not to break what already worked. So after every change, try the program on all the maps again.

The right-hand rule has a useful property: on its way, the dog also walks through the dead ends on its right-hand side, so it won't miss the bones in them. It just has to check on every tile whether there's a bone there, as in A Path with Bones. One If block does that. Every pass through the loop ends with a step onto the next tile, so if the dog checks for a bone at the start of each pass, it checks every tile it walks onto.

Instructions

  1. 1

    Pick up all the bones on all the maps.

  2. 2

    Walk to the goal.

Back

2/4

  1. 1. The Maze
  2. 2. Bones in the Maze
  3. 3. Fetch First
  4. 4. The Big Maze
Next

Try it yourself

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