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

To end the world, you can simply put Karel back in its starting location and clean up the balls by picking them up.