CS 330: Lecture 24 – Local Variables, Lists, and Pattern Matching
Let’s write a function. Turn to a neighbor and discuss how you’d solve this: You are given two points. On the perimeter of what circle do both points lie? Write things down and draw pictures to help your thinking. A very natural thing to do is start off with something like this: circletween :: Double […]
CS 318: Lab 17 – Hamburger Menus
Dear students, Today’s lab is designed around something I saw in a lot of your mockups: dropdown navigation menus. There aren’t a lot of new ideas here, but application of old ones. So, I won’t talk much. However, in this lab we start to incorporate a few of the pseudoclass selectors that you met in […]
CS 330: Lecture 23 – Haskell
Dear students, This class has hit upon two overall themes so far this semester. The first theme was the recognition and interpretation of a programming language. The second theme was types, which brought with it ideas about object orientation and static vs. dynamic decision-making. The third theme of the semester is functional programming, which has […]
CS 318: Lab 16 – Tables
Dear students, Today we explore the HTML table element. At its core, a table is just a grid of rows and columns. It supports headers, borders, and cells that extend across multiple columns and multiple rows. Before div and CSS positioning came along, tables were the primary vehicle for structuring a page. It was awful. […]
CS 330: Lecture 22 – Templates
Dear students, The most common application of templates is to create reusable collections. But in C++ we can also pass the compiler a value to help it specialize the templated pattern. For example, suppose we want lightning fast multiplication. Let’s take a first stab, which is anything but lightning fast: int multiply(int a, int n) […]
CS 330: Lecture 21 – Parametric Polymorphism
Dear students, Don’t get me started on arrays in C. What sort of world is this where an array is fixed in size, but yet it doesn’t know what that size is? We must fix this. Let’s create a growable array: class Flexray { public: Flexray() : capacity(10), nitems(0), elements(new int[capacity]) { } ~Flexray() { […]
CS 318: Lab 15 – Midterm
Dear students, Today we have a midterm. I’m cheering for you. Here’s your TODO list for next time: Complete CSS Diner, a game for learning a whole new set of CSS selectors that we will use throughout the second half of the semester. Read chapter 9 in your book. On a quarter sheet, share 2-3 […]
CS 330: Lecture 20 – Midterm Review
Dear students, Today we’ll go over the midterm together. It’s too good an opportunity to pass up. A bunch of problems that you’ve all looked at before class. Sincerely,
CS 318: Lab 14 – Viewport Parallax
Dear students, Let’s shake things up a bit today. When game developers get together to build a game in a very short amount of time, they call that a game jam. We will have a web jam. I want to devote all of today’s lab time to that, so I won’t be doing any talking. […]
CS 330: Lecture 19 – Vtables
Dear students, Did you know that in the early days of C++, it was just a thin veneer over C? Classes were just syntactic sugar. We might have had a class that looked like this: class Hero { public: Hero(char *name, int hp) { this->name = strdup(name); this->hp = hp; } void cure(int boost) { […]