In this class, lab has a very simple purpose: you will engage with problems in the “first-person.” Lecture tends to be sort of like a movie. The audience passively watches the instructor have an experience. Lab is more like a game, where you yourself have the experience.
Each lab is broken into two checkpoints. The tasks in each checkpoint are meant to help you encounter shortcomings in your current knowledge. With the help of a lab partner, your instructor, and teaching assistant, we want to help you grow some new neurons.
After you complete a checkpoint, let your instructor or teaching assistant know, and they will mark your completion in the gradebook. If you don’t complete them in lab, you can finish them on your own and show your work in the first 15 minutes of the next lab. After that, no credit will be awarded. Checkpoints will only be checked off in lab, not office hours.
First, find a lab partner. One of you will be person A. The other, person B. Then let’s get started!
You’ve seen repeat loops as a way to put a motor in your code:
repeat 5 print "Hi!" end
We’ve seen in lecture how we can use a loop to create a counter, a number that increases with each iteration:
i = 1 repeat 5 print i i = i + 1 end
There’s another form of loop that makes such counting even easier:
for i through 5 print i end
You might find this kind of loop helpful in some of the tasks below.
Person A types. Open in Madeup in Chrome.
Model the inverse of this and you’ve got all the makings for a really easy jigsaw puzzle!
What solidifier would make this stack of blocks easiest? Also, always work in steps. Don’t try to solve the whole problem at once. For instance, start by just getting the bottom row figured out.
Person B types. Write a Madeup program to create at least one of the following shapes. But try for both!
The grid shown here has ticks every 100 units.
Hint: solving this is easier if you use polar coordinates (what angles of the unit circle do we visit?) and convert them to Cartesian coordinates.