// SLIDE 01 — HOOK

CHAPTER 11 — BUILDING THE SIMULATION: CONDUCTING AT FULL COMPLEXITY

This chapter gives a working overview of Building the Simulation: Conducting at Full Complexity, focusing on the ideas a

Chapter 11 — Building the Simulation: Co — The three files are in place. The build begins. Every step has a specification, a handoff condition, and a labeled super
NARRATION

This chapter gives a working overview of Building the Simulation: Conducting at Full Complexity, focusing on the ideas a reader needs before moving to the next chapter. The chapter moves through Learning outcomes, Opening, Step 1: HTML scaffold, Step 2: CSS with the six DESIGN.md variables, and related ideas. Read it for the main argument, the vocabulary it introduces, and the practical judgment it asks you to develop. The three files are in place. The build begins.

// SLIDE 02 — OPENING

OPENING

CLAUDE.md was written. DESIGN.md had its six colors and its interaction vocabulary. PROJECT.md's Intent Layer named exac

Opening — The instinct, after three months of conducting practice and 45 minutes of file-writing, was to compose all five steps as
NARRATION

CLAUDE.md was written. DESIGN.md had its six colors and its interaction vocabulary. PROJECT.md's Intent Layer named exactly what the sorting simulator was for and what it refused to do. All three were committed to git. The teacher had slept on the files and made two small edits in the morning. The simulation was about to be built.

// SLIDE 03 — STEP 1: HTML SCAFFOLD

STEP 1: HTML SCAFFOLD

OperationGenerate index.html with the page scaffold for the sorting simulator.
InvariantsUse only the six DESIGN.md color variables (defined as CSS custom properties in :root). No styling beyond what is needed
ContextDESIGN.md interaction vocabulary (single-click, long-click, keyboard arrows, spacebar); accessibility requirements (keyb
Output formatSingle index.html file with semantic HTML5 — <main>, <section> for the array container, <section> for the controls, <asi
Negative constraintNo inline styles. No <script> tag yet (Step 3 owns the JS). No external resources (no CDN, no font imports — all assets
NARRATION

Operation: Generate index.html with the page scaffold for the sorting simulator. Invariants: Use only the six DESIGN.md color variables (defined as CSS custom properties in :root). No styling beyond what is needed for the scaffold to render. Context: DESIGN.md interaction vocabulary (single-click, long-click, keyboard arrows, spacebar); accessibility requirements (keyboard-navigable; ARIA labels on all interactive elements; minimum 16px font). Output format: Single index.html file with semantic HTML5 ,

,
for the array container,
for the controls,
// SLIDE 04 — STEP 2: CSS WITH THE SIX DESIG

STEP 2: CSS WITH THE SIX DESIGN.MD VARIABLES

OperationGenerate simulation.css containing only the DESIGN.md six variables defined in :root, plus the minimal rules required to
InvariantsExactly six color variables; no additional colors used directly anywhere (every color reference goes through a variable)
ContextDESIGN.md is the source of truth; if the spec contradicts DESIGN.md, DESIGN.md wins; flag the contradiction.
Output formatsimulation.css linked from index.html; visual matches DESIGN.md's described palette and typography.
Negative constraintNo additional colors. No hardcoded font names outside the typography section. No !important. No external font imports.
NARRATION

Operation: Generate simulation.css containing only the DESIGN.md six variables defined in :root, plus the minimal rules required to render the Step 1 scaffold with the design system's typography and spacing. Invariants: Exactly six color variables; no additional colors used directly anywhere (every color reference goes through a variable). Typography per DESIGN.md (monospace for numerics, system-ui for labels). Context: DESIGN.md is the source of truth; if the spec contradicts DESIGN.md, DESIGN.md wins; flag the contradiction. Output format: simulation.css linked from index.html; visual matches DESIGN.md's described palette and typography.

// SLIDE 05 — STEP 3: JS SIMULATION LOGIC (F

STEP 3: JS SIMULATION LOGIC (FIRST ATTEMPT AND PIVOTAL MOMENT 1)

OperationGenerate simulation.js with the bubble-sort algorithm as a function that takes an array and returns the sequence of stat
InvariantsPure function (no global mutable state). No DOM manipulation in this file (DOM updates are Step 4's concern).
ContextPROJECT.md Layer 1 — the simulation visualizes bubble sort step by step; the student controls advancement; the simulatio
Output formatfunction bubbleSortStates(array): State exported as an ES module.
Negative constraintNo setTimeout. No automatic animation. The function returns data; UI consumption (Step 4) drives the visualization.
NARRATION

Operation: Generate simulation.js with the bubble-sort algorithm as a function that takes an array and returns the sequence of states (each state is {array, comparing: , swapped: boolean}). Invariants: Pure function (no global mutable state). No DOM manipulation in this file (DOM updates are Step 4's concern). Context: PROJECT.md Layer 1 , the simulation visualizes bubble sort step by step; the student controls advancement; the simulation must support stepping forward and backward (which requires the full state sequence).

// SLIDE 06 — STEP 4: STEP CONTROLS AND KEYB

STEP 4: STEP CONTROLS AND KEYBOARD HANDLING (PIVOTAL MOMENT 2)

OperationGenerate the click and keyboard handlers in simulation.js (separate section from the algorithm; clearly bounded). Wire t
InvariantsSingle-click steps forward; long-click steps backward; keyboard arrows fine-control; spacebar play/pause. Per DESIGN.md,
ContextThe state sequence comes from bubbleSortStates; the consumer maintains a currentStateIndex and updates the DOM when it a
Output formatHandlers attached on DOMContentLoaded; the simulation is interactive on page load.
Negative constraintNo animation faster than 60ms per step. No hidden controls (per DESIGN.md). Accessibility: keyboard-only navigation must
NARRATION

Operation: Generate the click and keyboard handlers in simulation.js (separate section from the algorithm; clearly bounded). Wire the controls to the state-sequence consumer. Invariants: Single-click steps forward; long-click steps backward; keyboard arrows fine-control; spacebar play/pause. Per DESIGN.md, no drag-and-drop, no hover-only states. Context: The state sequence comes from bubbleSortStates; the consumer maintains a currentStateIndex and updates the DOM when it advances. Output format: Handlers attached on DOMContentLoaded; the simulation is interactive on page load. Negative constraint: No animation faster than 60ms per step.

// SLIDE 07 — STEP 5: MOBILE RESPONSIVENESS

STEP 5: MOBILE RESPONSIVENESS AND SCREENSHOT ITERATION (PIVOTAL MOMENT 3)

OperationAdd the CSS media query for mobile breakpoint (max-width: 768px). The array container reflows to vertical orientation; c
InvariantsDESIGN.md's typography and color rules unchanged at mobile breakpoint. Accessibility unchanged.
ContextDESIGN.md says minimum 16px font; mobile should not violate this.
Output formatsimulation.css extended with the media query; mobile rendering verified on Chrome devtools (iPhone 12 preset).
Negative constraintNo horizontal scroll at any breakpoint. No controls below the visible area at the breakpoint.
NARRATION

Operation: Add the CSS media query for mobile breakpoint (max-width: 768px). The array container reflows to vertical orientation; controls stack below; comparison counter moves to a fixed footer. Invariants: DESIGN.md's typography and color rules unchanged at mobile breakpoint. Accessibility unchanged. Context: DESIGN.md says minimum 16px font; mobile should not violate this. Output format: simulation.css extended with the media query; mobile rendering verified on Chrome devtools (iPhone 12 preset). Negative constraint: No horizontal scroll at any breakpoint. No controls below the visible area at the breakpoint.

// SLIDE 08 — TEACHER BUILD: EXECUTE PHASE 1

TEACHER BUILD: EXECUTE PHASE 1 OF YOUR SIMULATION

Apply the chapter's discipline to your own simulation (from Chapter 10's three files).

Teacher build: execute Phase 1 of your s — Walk through five steps appropriate to your simulation's domain. Adapt the chapter's specifics. Expect at least one pivo
NARRATION

Apply the chapter's discipline to your own simulation (from Chapter 10's three files). Walk through five steps appropriate to your simulation's domain. Adapt the chapter's specifics. Expect at least one pivotal moment per step (handoff failure, scope creep, or screenshot iteration) on the first build.

// SLIDE 09 — CLASSROOM ACTIVITY: STUDENTS B

CLASSROOM ACTIVITY: STUDENTS BUILD A SMALL SIMULATION

Provide a small simulation target — a visualization of a single data structure operation (stack push/pop, queue enqueue/

Classroom activity: students build a sma — Each student writes the three files for their target (PROJECT.md Layer 1, DESIGN.md with six colors and an interaction v
NARRATION

Provide a small simulation target , a visualization of a single data structure operation (stack push/pop, queue enqueue/dequeue), a probability tree for a single coin-flip sequence, a sentence-tree for one short sentence. Small enough to fit in a 50-minute class. Each student writes the three files for their target (PROJECT.md Layer 1, DESIGN.md with six colors and an interaction vocabulary, a minimal CLAUDE.md). They execute the build using the per-step gate. They document every pivotal moment in the Generation Log.

// SLIDE 10 — COMMON MISCONCEPTIONS

COMMON MISCONCEPTIONS

"With three files, the build should run itself.""I'll skip explain on familiar commands.""Scope creep is fine for a single simulation.""Screenshot iteration is for visual designers.""The Generation Log is bureaucracy."
NARRATION

"With three files, the build should run itself." No. The three files constrain; the per-step gate remains. Architecture is upstream; the gate is the runtime. "I'll skip explain on familiar commands." Step 3's setTimeout violation is a real example of the failure mode. Even familiar commands have surprises in the simulation domain.

// SLIDE 11 — AI WAYBACK MACHINE

AI WAYBACK MACHINE.

Donald Schön (1930–1997) — American philosopher and urban planner whose The Reflective Practitioner (1983) introduced th

AI Wayback Machine — The Generation Log in PROJECT.md Layer 2 is Schön's reflection-in-action made into an artifact. The Generation Log captu
NARRATION

Donald Schön (1930, 1997) , American philosopher and urban planner whose The Reflective Practitioner (1983) introduced the concept of reflection-in-action: the practitioner's capacity to think about what they are doing while they are doing it, adjusting in real time as the work surfaces conditions the upfront plan did not anticipate. Schön's argument was against the technical rationality model , the view that professional work is the mechanical application of pre-formed expertise to standard situations.

// SLIDE 12 — THESIS

THE CORE CLAIM.

Donald Schön (1930–1997) — American philosopher and urban planner whose The Reflective Practitioner (1983) introduced th

The Generation Log in PROJECT.md Layer 2 is Schön's reflection-in-action made into an artifact. The Generation Log captu

NARRATION

Donald Schön (1930, 1997) , American philosopher and urban planner whose The Reflective Practitioner (1983) introduced the concept of reflection-in-action: the practitioner's capacity to think about what they are doing while they are doing it, adjusting in real time as the work surfaces conditions the upfront plan did not anticipate. Schön's argument was against the technical rationality model , the view that professional work is the mechanical application of pre-formed expertise to standard situations.

// SLIDE 13 — CLOSE

ASK THE QUESTION. APPLY THE FRAMEWORK.

OPENING//STEP 1: HTML SCAFFOLD//STEP 2: CSS WITH THE SIX

Claude Code for Teachers · Ch.13 · Chapter 11 — Building the Simulation: Conducting at Full Complexity

NARRATION

That is the framework. Claude Code for Teachers, chapter 13: Chapter 11 , Building the Simulation: Conducting at Full Complexity. The patterns are now in place. Apply them.

01 / 13
Claude Code for Teachers · Ch.13 · Nik Bear Brown