To start this assignment, download this zip file.
Homework 1c — While
1. Blue square
Run the code in blue_square.py
. You will notice that it has an error. Can you
fix it? The final world should look like this:
2. Go to the lake
Bit wants to get to the lake. He doesn’t know how to get there. He asks for directions.
Bit: “How do I get to the lake?”
Helpful passerby: “Take a left at the stop sign.”
Write your code in go_to_lake.py
. There are two starting worlds; in both worlds, bit starts at the bottom, pointing up towards a red square, with the lake on the left. This one of the starting worlds:
This is how it should look when Bit has arrived at the lake:
3. Red line
Bit needs to leave his room (black squares), finish the red line, and return to his room.
Write your code in red-line.py
. This is the starting world:
This is how it should look after Bit finishes their task:
Grading
Activity | Points |
---|---|
blue_square.py | 4 |
go_to_lake.py | 8 |
red_line.py | 8 |
Manual grading will focus on decomposition and correct use of while
statements.