pop quiz
Grug asks a question from every topic. Say the answer out loud, then tap. Questions you miss return sooner, and questions you know return after a longer gap.
The cards below are a no-script preview. With the page script on, the whole question bank loads from quiz-bank.js and grug draws from it instead.
try first, then show answer
2. A single Game value
Game in state.ts:6#aggregate holds both paddles, the ball and the accumulator. A canvas texture holds pixels, and draw never writes scores.
try first, then show answer
3. Once per drawn frame
main.ts:8#read_input calls the reader once, then passes the snapshot to advance. Several steps can share one snapshot.
try first, then show answer
1. Nothing in the game
draw_game at draw.ts:9#draw_game returns drawing commands and writes no field of Game.
try first, then show answer
3. The length of one simulation step
FIXED_STEP at update.ts:6#120 is one step of simulation time. Window size and scores live in state.ts.
try first, then show answer
3. vx alone
The paddle pass at update.ts:62#hface reverses vx and leaves vy alone. It runs after the horizontal move.
try first, then show answer
2. The left paddle
The right edge test at scoring.ts:9#WINDOW_W adds a point to the left score. A ball that leaves on the left adds a point to the right score.
try first, then show answer
3. One boundary for reads and writes
state.ts:6#aggregate puts the round in one value. update.ts writes that value and draw.ts reads it, so the boundary is visible in function arguments.
try first, then show answer
3. The ball landing differently on two refresh rates
The reason note names a 60 Hz screen and a 144 Hz screen in docs/001-fixed-timestep.md:11#60. A variable step makes the same input land at two places there.