Around the Lawn

In the middle of the park is a big lawn with a path around it. Dogs aren't allowed on the grass, so the dog has to walk around the lawn on the path. The owner has hidden the last four bones there: two in the corners of the lawn and two in the middle of its long sides. Take the dog once around the lawn and pick up all four.

The flower bed in the Loops lesson was square: all its sides were the same, so the part that repeated was one side. The lawn isn't square, and its neighboring sides are different. But the walk around it still has a part that repeats. Find it. To fit the block limit, you'll need nested loops.

A tip: compare the opposite sides of the lawn: the bottom with the top, and the left with the right.

That's the whole walk. With just two lessons behind you, you've guided the dog along long paths with a handful of blocks: in each path, you found what repeats and let loops repeat it. Each time, though, you knew the path in advance and could count its steps. In the next lesson, you'll learn loops that work even when you can't count the steps in advance.

Instructions

Pick up all four bones.

Use at most 11 blocks.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

3/3