Today was a non-teaching day, so I made some “progress” in Twoville: You could summarize my professional career as one long effort to get to the point where I can express non-trivial ideas about shapes and animations in around 30 lines of code that doesn’t need to be compiled.
Dear students, We’ve seen the computer as a calculator, crunching numbers. We’ve seen the computer as a chef, calling upon recipes of code. We’ve seen the computer as a philosopher, considering truths about our data. Now it’s time to let those truths drive our computer’s actions. We will see the computer as a pilot, navigating […]
See the questions and answer sheet.
Dear students, Today we have a midterm instead of our regularly scheduled lecture. I am providing a list of the methods that you may or may not need as you complete the exam. Here’s your TODO list to complete before we meet again: Homework 3 is officially assigned. It is due October 25. You must […]
Last week I was trying to think of boolean predicates that I could use for exercises in an introductory programming class. I remembered the triangle inequality, which states how the lengths of three line segments must relate if they are to be formed into a triangle. In short, each segment must be shorter than the […]
In our introductory programming class, I try to reframe abstract logic into concrete spatial thinking. One way I do this is through the game Trux Falsy. Another way is through Venn diagrams. I want students to see how the AND operator creates an intersection, how the OR operator creates a union, and how DeMorgan’s Law […]
Dear students, Today’s our last day of talking about booleans as an independent idea. We will examine an unexpected behavior of our logical operator friends and then discuss one more way to visualize logic: the Venn diagram. Short-circuiting Next up we’ll examine the following piece of code. What is the output from each statement? public […]
Welcome to lab 6! If you have checkpoints from the last lab to show your instructor or TA, do so immediately. No credit will be given if you have not already completed the work, nor will credit be given after the first 10 minutes of this lab. In this lab, we’ll explore the logical operators […]
Dear students, Today we keep asking questions about data. Let’s start with some blackboxes! Blackbox #1 Blackbox #2 Blackbox #3 Blackbox #4 Blackbox #5 Blackbox #6 Now let’s do some more free-form exercises: Has digit? Does a password contain at least one digit? No attachment? Is the word “attachment” absent from the body of an […]
Dear students, We’ve seen the arithmetic operators. We’ve seen the relational and equality operators. Today we meet the logical operators &&, ||, and !. These operators have boolean operands and yield boolean values; they are designed for gluing together simple predicates into compound ones. Before we look at them, let’s complete a little warmup exercise. […]