Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Village Draughts moves: `moves(state)` checked against an independent rule check across 200 seeded games in `village-draughts/board.test.mjs` #292
Reviewed pull #296 at its head: ticked The test file holds a small independent checker written in the test, not imported from board.js. For a state and a listed move, it confirms that: a step is one diagonal square onto an empty square, forward for a man and in any direction for a king; each jump hops an opposing piece onto an empty square; no listed move is a step while some piece can capture; a listed jump path cannot be extended by a further jump unless it ended by crowning a man; and a man's move that ends on the far row ends there.; For seeds 1 to 200, a whole game played by reply for the opponent and a seeded pick from moves for the player has every move moves lists pass the checker. Every move move accepts is in the list. move refuses, with the state unchanged, a prefix of a listed multi-jump, a move by the side not to move, and a step while a capture is available.; If a seed fails, board.js is fixed and the pull names the seed and what was wrong; the existing tests still pass.; bun test village-draughts/board.test.mjs runs in under one second on its own, and the pull states the measured time..
The one box left open on #276 after pull #289 landed.
moves,move, forced captures, multi-jumps and crowning are on main with hand-built tests. What is missing is proof across real games that the move list is exactly the legal one. Do not redo the rules.Done looks like:
Files:
village-draughts/board.test.mjs, andvillage-draughts/board.jsonly if a seed fails. Risk: none outside the folder. Fits: a builder.