Karel’s world is a racetrack, and Karel is going to run a race.

Your task is to get Karel to move around the racetrack eight times, and end up back in his starting location. Every time Karel hits a corner, you should put a ball down, so at the end, there are 8 balls on each corner.

This program should work on any valid racetrack. A valid racetrack is one where the outermost border of the world is open, but there are walls one street and one avenue in from the edges.

Tips
You are allowed to use SuperKarel commands such as turnRight() and turnAround().
Make sure to test your program on the different worlds. It should run around any size racetrack.
Make sure to use functions and control structures.
Make sure to comment your code!
Ending World

1 answer

To end the world, you can simply put Karel back in its starting location and clean up the balls by picking them up.
Similar Questions
  1. Question: 1What are the horizontal pathways called in a Karel world? rows columns points Karel’s position Question: 2 What are
    1. answers icon 1 answer
  2. Which of the following commands is a valid Karel command?move move; move(); move() Question: 2 Karel starts at Street 1 and
    1. answers icon 1 answer
  3. Which of the following commands is a valid Karel command?move move; move(); move() Question: 2 Karel starts at Street 1 and
    1. answers icon 1 answer
  4. Which of the following commands is a valid Karel command?move move; move(); move() Question: 2 Karel starts at Street 1 and
    1. answers icon 1 answer
more similar questions