To start this assignment, download this zip file.
The following guide pages cover material needed for this assignment:
The following link covers essentials of using Bit https://spring2024.byucs110.org/resources/bit-reference/
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:
Manual Grading
Refer to the Quality Code guide page for detailed explanations and examples on each of these rubric criteria.
Remember to break the problem down into functions with one clear purpose.
Go to lake and red line both tell a story. We want you to practice decomposition. For full points, use multiple functions on these two problems.
Intent
The intent of this assignment is for you to correctly use while loops.
- Code that calls bit.move() many times is likely incorrect.
- While loops that only run once are unnecessary, and we will point them out to you.
- Only one line in blue_square.py should be changed.
Rubric | Points |
---|---|
Whitespace | 1 |
Naming | 1 |
Decomposition | 4 |
Intent | 4 |
Total | 10 |
Grading
Activity | Points |
---|---|
blue_square.py | 4 |
go_to_lake.py | 8 |
red_line.py | 8 |