← the terminal · instructor

W20 // LOOPS: WHILE, FOR, NESTED

JAN 27 · Ch 8 Sec 5-7 · DUE: Loop lab (milestone)

This week's deckPPTX

// RUN OF SHOW (8:45-10:15)
8:45

Stand-up: last week's deliverable graded, questions answered

9:00

This week's presentation

9:20

At the keyboard: guided type-along

9:45

Build time: assignment or project work

10:10

Close: commit, push, and preview next week's reading

// THE POINT THIS WEEK
The while loop. The for loop. Nesting and looping patterns.
// TALKING POINTS
Loops repeat on purpose
  • while repeats as long as its condition holds
  • for packs setup, test, and step into one line
  • Something in the loop must change the condition, or it runs forever
Nested loops cover grids
  • Outer loop rows, inner loop columns: every cell visited once
  • The inner loop finishes completely on every outer pass
  • Trace with small numbers first: 3x3 before 100x100
> TREASURE HUNT WEEK

The Infinite Loop opens today: student door · foreman key. Badge L. Run it in the build block or assign as the week's warm-down.

// LINKS