Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/features/learn/CheatSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export function CheatSheet() {
<p>÷4 yes · ÷100 no · ÷400 yes again. (Non-century year: last two digits ÷4.)</p>

<h3>Month anchors</h3>
<p className="muted" style={{ fontSize: 13, marginTop: 0 }}>
Jan/Feb shown for common years; each is +1 in a leap year.
</p>
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
<tbody>
{months.map(([m, a]) => (
Expand Down
20 changes: 20 additions & 0 deletions src/features/learn/curriculum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block, { kind: 'list' }> => 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)
})
Expand Down
6 changes: 3 additions & 3 deletions src/features/learn/curriculum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
],
},
Expand Down
Loading