Lecture 1: DrRacket and arithmetic
1 Welcome!
This first lecture page shows how the other lecture pages in this course will look. There are several sections, each with videos for you to watch. After each video, there are some quick exercises to check your understanding. Do the exercises before moving on to the next video.
You don’t need to submit anything for this lecture. But starting with the next lecture, you are required to submit the online exercises, so that we can confirm that you are keeping up. This is due by midnight on Tuesday and Sunday before each in-person lecture.
Exercise 2. We will use Discord to ask and answer questions, make announcements, and hang out. Sign up with the link we announced on Canvas when the course started. Change your nickname on Discord to the full name you’d like us to use in this class. Then, introduce yourself in the #introductions channel.
If you would like to talk to only instructors on Discord, type /breakout (with a forward slash at the beginning of the message) then hit Enter. This should create a “breakout channel” that only you and the staff can see.
Two safety tips on Discord (actually, on any network): First, enable two-factor authentication (next to your password setting). Second, don’t open any download you receive through a private message.
2 Practicing computer science
Just as with learning to do something with your body like playing a new sport, in order to learn computer science, it is not enough to watch other people play or to photocopy the sweat stains they leave behind. You have to practice yourself. You have to sit in front of a computer and make mistakes, as well as talk to people, read articles, write. This course will require you to do all of these things.
Two lecture assignments, due online at midnight on Tuesday and Sunday. (To prepare for some lectures, there is an additional reading assignment that requires you to read articles that are many pages long.)
Two lecture sessions, on Monday and Wednesday for C211 and on Tuesday and Thursday for H211. Lectures will meet in person.
One problem set, due online at midnight on Wednesday. Start early.
One lab, on Thursday or Friday. Each lab will come with a set of exercises to practice what you learned that week. Labs will meet and be graded in person.
3 Download and install DrRacket
Start DrRacket (not Racket). In the lower-left corner, choose the language Beginning Student, because that is the language we will be using. In the upper-right corner, click the Run button, so that the change takes.
4 DrRacket as a calculator
Exercise 4. Use the Beginning Student language to add the numbers 123, 456, and 789 together. (Hint: the + operation can take more than 2 inputs at once.)
5 Chaining operations
Exercise 6. Use the Beginning Student language to add the numbers 123, 456, and 789 together, but do not give the + operation more than 2 inputs at once. Instead, use the + operation twice, each time with just 2 inputs.
6 The definitions window
579 1368 5790 1368
7 Comments
; Exercise 3 ; Exercise 4 ; Exercise 5 ; Exercise 6
8 Stepping
The code written in the videos above is available for your reference. To download it, don’t use “Save Page As” or “Save As”; use “Save Link As” or “Download Linked File” in your Web browser. If you can’t find the command, try right-clicking or two-finger-tapping or long-pressing.
9 Images
(require 2htdp/image)
; overlay : Image Image -> Image ; underlay : Image Image -> Image ; above : Image Image -> Image ; beside : Image Image -> Image ; place-image : Image Number Number Image -> Image
Add your formula for combining the images to the bottom of your Definitions, so that when you click the Run button, the Interactions Window shows 4 numbers followed by 1 composite image.
10 Making images
The code written in the videos above is available for your reference. To download it, don’t use “Save Page As” or “Save As”; use “Save Link As” or “Download Linked File” in your Web browser. If you can’t find the command, try right-clicking or two-finger-tapping or long-pressing.
That’s it for this lecture!
Optional: Read the Prologue and Chapter 1 of the textbook.