pop quiz
Grug asks a question from every topic. Say the answer out loud, then tap. what junior miss come back sooner. what junior know go away for a while.
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
4. It adds the delta to the balance
apply has one operation: balance + delta. A credit adds; a debit is a negative delta.
try first, then show answer
4. The order in which deltas reach the balance
A fold over a list visits entries in order. The balance after each step is the input to the next step.
try first, then show answer
2. start plus List.sum deltas
start + List.sum deltas is independent of apply. It stays correct when apply changes.
try first, then show answer
2. In every step of the fold, because replay calls apply for each entry
replay folds over the entries with the same addition, so a wrong sign in apply changes every step. The closed-form oracle uses List.sum, which stays correct when the implementation changes.
try first, then show answer
3. The replayed balance differs from the sum, so the check goes red
Subtraction over the same entries from the right gives a different answer. The closed-form oracle uses addition, which does not change with the implementation, so the mismatch is visible.
try first, then show answer
1. The test goes green because both sides use the same wrong operation
Both sides change together when the oracle calls the implementation. A green result then says the two agree, not that either is correct.