CS 330: Lecture 13 – Types: Safe vs. Unsafe
Dear students, While you’re waiting for class to start, here’s a little exercise for you to discuss with your neighbor: How would you write an algorithm for computing the score of a hand of Blackjack? Face cards are worth 10, aces are worth 1 or 11, and everything else is worth its rank. Sum up […]
CS 330: Lecture 12 – Type Systems Continued
Dear students, Last time, we introduced types as one of the distinguishing features of a programming language. We enumerated a bunch of types commonly supported in programming languages and distinguished between static, dynamic, and duck typing. The first two identify the time at which types are inspected, and the latter referring to the idea that […]
CS 318: Lab 9 – Fixed Positioning
Dear students, Today we begin our exploration of the several ways to break away from the normal left-to-right, top-to-bottom flow of a web page. We started with fixed positioning, because it introduces the ideas of anchoring outside the hierarchy. In fact, fixed position effectively removes an element entirely from its natural position in the hierachy […]
CS 491: Lecture 4 – Pathlete
Dear students: Today we implement a little puzzle game inspired by The Legend of Zelda: Link’s Awakening: To make this happen, we’ll use an analog joystick to direct the platform. These commonly have five pins: voltage, ground, a horizontal analog pin, a vertical analog pin, and a digital button pin. Let’s hook up circuit like […]
CS 330: Lecture 11 – Type Systems
Dear students, Today we begin our focus of programming language concepts, rather than the tools (regex, lexers, and parsers) that we use for interpreting programming languages. In particular, we start off with types. To get us started, here’s a question to discuss with your neighbor. What are types? Why do have them? In the past, […]
CS 318: Lab 8 – Horizontal Alignment and Gradients
Dear students, Today, we will continue to explore the box model—because we need to. The vast majority of our difficulties with designing for the web will involve alignment and positioning. Suppose you want to horizontally center an element. What must be true? It must be a block element. Centering doesn’t make sense for phrase elements. […]
CS 330: Lecture 10 – Conditionals and Loops
Dear students, The dream of every machine is to amplify human effort—turning a little force at the input end to a big effect at the output end. Our language is starting to have this quality. With just a few utterances we can draw a picture. But there are still two big things missing from it: […]
CS 318: Lab 7 – Box Model
Dear students, Let’s stop a moment to reflect upon what we have done so far this semester: We’ve organized information in a hierarchy and represented it in plain old text. We’ve seen how to make our text “hyper” through the use of images and links. We’ve added style to established elements of this hierarchy. We’ve […]
CS 330: Lecture 9 – Assignment and Operators
Dear students, We’ve got a little programming language up and running. It’s got commands for drawing rectangles and circles, and it supports integer literals and variables. Today we add to it variable assignments and operators. Next time we’ll add loops and functions. To help us get a feel for what our programs will look like […]
CS 330: Lecture 8 – Parsing
Dear students, We started writing our own lexer last time. Today, we’re going to get a parser that tries to make sense of those tokens. But first, we should talk about what kind of programming language we’re writing. Let’s write a language for drawing things with shapes. Really simple shapes. We’ll need a name for […]