Written by Juliette Woodrow and Tara Jones
This week in section, your first priority is to meet your section leader and discover what sections in CS106A are all about. Your section leader will spend the first part of this week's session on introductions and telling you the things you need to know. Afterwards, they will move on to cover some of the important material from class in a setting that is small enough for you to go over practice problems and ask questions. This week, your goal is to gain familiarity with nested loops and images.
Reverse Santa
In this problem, your goal is to help bit get up a chimney! Use the bit syntax from lecture to help solve this world! Move bit forward until an open square appears above - the chimney! Move bit up the chimney until an open square appears to the right. Move bit to that square.
Here is an example run of the function:
Start:
End:
Standard Santa
In this problem your job is to define a function to help Bit get down a chimney! Bit/Santa is on the roof, facing the left side of the world. Move bit forward until an opening appears below - the chimney. Move bit down the chimney (into the house) until blocked. Turn right at the bottom, and move until blocked. Paint green all the squares bit occupies in the house.
Here is an example run of the function:
Start:
End:
Holes
Bit has a wall at its back and is facing into a hole that is 1 or more squares deep. Move bit forward until blocked, painting every moved-to square blue. This will fill the hole with blue. Then return to the original location and facing.
Here is an example run of the function:
Start:
End: