diff --git a/src/features/learn/CheatSheet.tsx b/src/features/learn/CheatSheet.tsx index 35a6d91..a9645da 100644 --- a/src/features/learn/CheatSheet.tsx +++ b/src/features/learn/CheatSheet.tsx @@ -40,6 +40,9 @@ export function CheatSheet() {

÷4 yes · ÷100 no · ÷400 yes again. (Non-century year: last two digits ÷4.)

Month anchors

+

+ Jan/Feb shown for common years; each is +1 in a leap year. +

{months.map(([m, a]) => ( diff --git a/src/features/learn/curriculum.test.ts b/src/features/learn/curriculum.test.ts index 75f3da6..cc3e3cc 100644 --- a/src/features/learn/curriculum.test.ts +++ b/src/features/learn/curriculum.test.ts @@ -23,6 +23,26 @@ describe('curriculum', () => { expect(text).toContain('last two digits') expect(text).toContain('unless they are 00') // the xx00 carve-out is still called out }) + it('Stage 3 labels Jan/Feb anchors common-year vs leap, leaving others unqualified (#8)', () => { + const items = (getStage('months')?.blocks ?? []) + .filter((b): b is Extract => b.kind === 'list') + .flatMap((b) => b.items) + const jan = items.find((i) => /january/i.test(i)) ?? '' + const feb = items.find((i) => /february/i.test(i)) ?? '' + for (const item of [jan, feb]) { + expect(item).toMatch(/common year/i) // lead value labeled non-leap + expect(item).toMatch(/leap year/i) // secondary value labeled leap + } + expect(jan).toContain('3') + expect(jan).toContain('4') + expect(feb).toContain('28') + expect(feb).toContain('29') + // Even-month doubles (4/4 … 12/12) are leap-invariant — they must NOT gain a + // leap qualifier. Match same-number-both-sides so March's "3/14" is excluded. + const doubles = items.filter((i) => /\b(\d+)\/\1\b/.test(i)) + expect(doubles.length).toBeGreaterThan(0) + for (const d of doubles) expect(d).not.toMatch(/leap/i) + }) it('every stage has content', () => { for (const s of CURRICULUM) expect(s.blocks.length).toBeGreaterThan(0) }) diff --git a/src/features/learn/curriculum.ts b/src/features/learn/curriculum.ts index bab179a..b0963ee 100644 --- a/src/features/learn/curriculum.ts +++ b/src/features/learn/curriculum.ts @@ -99,13 +99,13 @@ export const CURRICULUM: Stage[] = [ kind: 'list', items: [ 'March: Pi Day, 3/14', - 'January: the 3rd (the 4th in leap years)', - 'February: the last day — 28th (29th in leap years)', + 'January: the 3rd in common years, the 4th in leap years', + 'February: the last day — the 28th in common years, the 29th in leap years', ], }, { kind: 'p', - text: 'In leap years Jan and Feb shift by one — the trap that catches everyone.', + text: 'Only Jan and Feb change in leap years — the trap that catches everyone.', }, ], },