
Karl Toby Rosenberg
Contact: karltobyrosenberg [-at-] nyu [-dot-] edu
I try 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.
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 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 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
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
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.
Functions are like configurable ovens that let you bake cakes.
Walking through how to iterate over a 2D grid