To start this assignment, download this zip file.
The following guide pages cover material needed for this assignment:
Lab 2b β Conditions
Preparation
Download the zip file for this lab, located above. This zip file has worlds that
you will use for Bit. Extract the files and put them in your cs110 directory
in a folder called lab2b.
Paint the box
Bitβs job is to paint a green box. There are two worlds. The first world starts like this:

After Bit paints a green box, it looks like this:

The second world looks like this:

After Bit paints a green box, it looks like this:

You have starter code in paint-the-box.py.
Notes:
- Your code needs to be general enough to solve both worlds.
- Notice that Bit ends where it starts, facing the same direction.
- Think about the stopping condition β when does Bit stop painting?
- This problem does not use
andoror.
Questions to think about:
- What was your stopping condition?
- What other conditions did you need?
Red Roses
In this problem, Bit needs to turn all of the roses red. Here is one of the worlds:

At the end, Bit should have turned all of the blue and green squares into red ones:

You have starter code in red-roses.py.
Notes:
- What is the stopping condition?
- What other conditions do you need?
Compare your solution on this problem to the solution on the previous problem.
Clear green
In this problem, Bit needs to clear only the green squares that are next to the black squares. One of the worlds looks like this:

At the end, Bit should have cleared all of the green squares that are next to a black square:

Notes:
- What is the stopping condition?
- What conditions can Bit use to decide whether to erase a square?
Remember, use bit.paint('white') to erase a square.
Questions to consider:
- Did you use two
ifs or oneifand oneelif? - Is there any difference?
Grading
To finish this lab and receive a grade, upload a screenshot of your code to Canvas. See Lab 2b in Canvas for additional instructions.
We are providing a solution so you can check your work. Please look at this after you complete the assignment. π