A game told: twenty-seven written moves stepped through on the boards with a callout wherever there is something to see, and a composer to write the next one

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
Eric WagonerandClaude Fable 5.1 committed 2026-10-26 18:38:59 -04:00
1 parent c8443c6f50
commit 965a28142c
7 files changed
+298 -4

No files matched your search

+19
View File
@@ -61,3 +61,22 @@ describe('the lessons', () => {
void other;
});
});
describe('the game told', () => {
it('plays through the engine from the opening to a checkmate, and every callout sits on a move', async () => {
const { toldStates, TOLD_MOVES, CALLOUTS } = await import('./told');
const states = toldStates();
expect(states).toHaveLength(TOLD_MOVES.length + 1);
const last = states[states.length - 1];
expect(last.end).toBe('mate');
expect(last.over?.winner).toBe('A');
for (const n of Object.keys(CALLOUTS).map(Number)) expect(n).toBeLessThanOrEqual(TOLD_MOVES.length);
// The things the callouts say happened.
expect(last.moves[8].captured).toBe('R');
expect(last.moves[16].kind).toBe('B');
expect(last.moves[20].captured).toBe('H');
expect(last.moves[23].captured).toBe('H');
expect(last.moves[26].captured).toBe('S');
expect(last.moves[26].check).toBe(true);
});
});