← the terminal · instructor

W32 // CAPSTONE: INIT, HITS, PLAYER TURN

APR 28 · Ch 13 Sec 7-9 · DUE: Playable player turn

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
Initialization flow. Hit detection in pure logic. The player's turn via events.
// TALKING POINTS
The player's turn
  • Click a cell, resolve hit or miss, update state, re-render
  • Guard clauses: ignore clicks on already-fired cells
  • Feedback matters: the player should never wonder what happened
Initialization
  • A new game builds fresh state from scratch, on demand
  • Randomized ship placement uses week 20's loops and week 19's checks
  • Test init twenty times; random bugs hide in the dice
// LINKS