
Karl Toby Rosenberg
Contact: karltobyrosenberg [-at-] nyu [-dot-] edu
I tend to extend the curriculum with concepts from interactive systems, creativity tools, human-computer interfaces, visuals, and game programming
I tend to motivate concepts by building interactive, playable visual artifacts. This is a flood-fill algorithm visualization that works with an actual animation system that can be paused, fast-forwarded, and reset by live-coding as the program is running. In this case, I can change the starting position of the grid.
I want students to have the experience of learning through making and designing something to have something motivating and "tangible". For example, they build this simple infinite canvas sketching user interface in my version of Data structures, starting with an empty interface they develop throughout the semester as they add more data structures. e.g. Dynamic Arrays for curves, stacks for history/undo-redo, game-programming concepts such as entity component ID systems for objects, 2D camera panning and entity selection.
I took inspiration from Piet Mondrian's paintings to create an exercise in which students must create conditional structures around the dimensions of rectangles, and check whether the mouse cursor overlaps specific ranges to decide whether to fill a rectangle black. I can also use a version of this example to illustrate recursion.
I believe it's valuable to introduce the idea of drawing and designing ideas first before coding, in preparation for interaction with team-mates. This is an anonymized example collected with a student's permission showing the process of solving a recursive algorithm for exploring a maze featuring time-travel between different versions of the maze in search of a machine to destroy in the past.
This visualization for a recursive count-down zoom is something I intend to narrate over in steps to show how as we go deeper into the recursive algorithm, the substructure looks identical as before, but with different data every step as the problem is brokendown. The stop sign is a metaphor for representing the base case as a literal stopping point. I like creating these more playful examples to provide something more memorable and spatial when exploring concepts for the first time before going into specific algorithms or code.
I like to explain code as a walk along a path, with parallel visualizations for the flow/journey and the corresponding data behind the scenes
We can think of conditional branches as routes along a branching railroad track
Students need to interpret this drawing to create a conditional structure that checks random variables to decide whether the hero can make it through the quest to defeat the dragon or not. I like giving examples that require taking a visual scenario and figuring-out how to express it in code.
We can think of error-handling as creating a trampoline beneath a perilous code path, to give the program flow towards a safe way out
Functions are like configurable ovens that let you bake cakes.
Walking through how to iterate over a 2D grid