Skip to content

Repository files navigation

The Cow 🐄

An interactive trainer for the Cow — the opening system WFM Anna Cramling invented and Tyler1 spammed on his climb from 199 to ~1900 on Chess.com.

Six moves, every game, either colour, regardless of what the opponent does:

Moves
White e3, d3, Ne2, Nd2, Nb3, Ng3
Black e6, d6, Ne7, Nd7, Nb6, Ng6

Play it

What's in it

Lessons — six guided lines you play move by move: the setup itself, the central break that makes the system work, the prophylaxis against its one real refutation, the Black version, a move-three checkmate, and the Ng3–f5 attacking jump. Every line is verified legal, and the tactical claims are checked programmatically rather than asserted in prose.

A hint ladder rather than an answer button. Level 1 names the piece type, level 2 makes that piece pulse on the board, level 3 draws the arrow and offers to play it. Wrong guesses escalate the ladder on their own, so nobody gets stuck.

Drill — play the Cow against a built-in engine at four strengths, with four opponent personalities (a book-follower, a space-grabber, an anti-Cow flank attacker, and a fianchettoer). The setup moves are enforced: play something that isn't the Cow and the board bounces it back.

A position coach that reads the actual board once the setup is done and draws what it finds: a safe central break, an incoming horn kick, an untouchable knight outpost, or one of your pieces hanging.

Progress (lessons completed, clean builds, win/loss record per opponent) is kept in localStorage and never leaves the browser.

Engine

lib/engine.ts — alpha-beta negamax with iterative deepening, quiescence search, MVV-LVA move ordering and piece-square tables, in about 150 lines with no dependencies beyond chess.js. Each level has a "sloppiness" factor so weaker settings blunder like a human instead of playing randomly. Every search runs inside a time budget, so it never hangs the page.

It is a club-strength opponent for practising an opening, not an analysis engine. Don't take its evaluations to a tournament.

Develop

npm install
npm run dev      # http://localhost:3553
npm test         # lesson lines, engine, coach, hints
npm run lint
npx tsc --noEmit

npm test runs four suites of plain Node scripts (no test framework): every lesson line is replayed through chess.js for legality, the checkmate lesson is confirmed to be mate, both Nf5 outposts are confirmed unattackable, the engine is checked for mate-finding, material safety and time budgets, and the coach and hint ladder are checked against constructed positions.

Deploy

Static export to GitHub Pages via .github/workflows/deploy.yml. The workflow runs the tests, lint and typecheck before it will publish. PAGES_BASE_PATH is injected by actions/configure-pages, so local builds stay at the root.

Honest caveats

The Cow is objectively a small concession — engines give the other side a slight edge, and its one real refutation (pushing a- and h-pawns to kick the knights off b3/g3) is a real thing you have to know how to stop. Its value is practical: it is the same six moves against everything, so you spend your thinking time on chess instead of on memorising theory.

Sources

Licence

MIT

About

Learn the Cow opening (e3, d3, Ne2, Nd2, Nb3, Ng3) — lessons, hint ladder, drill mode with a built-in engine

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages