M1: ядро правил дурака (чистый TypeScript, без движка)
Детерминированный конечный автомат: apply(state, action) -> {state, events}.
Весь набор правил из GAMEPLAY.md проверяется headless-тестами.
- карты: Suit/Rank/Card (флайвейт, 36 штук), колода
- GameState + клонирование и сериализация в JSON
- действия (attack/defend/take/pass) и события для слоя отображения
- раздача, выбор первого атакующего, лимиты подкидывания,
взятие карт, добор, выбывание игроков, определение дурака
- 64 теста, strict typecheck
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+8
-8
@@ -34,15 +34,15 @@ progress. The Cocos layer only renders state and turns taps into actions.
|
||||
- [x] Headless test harness (vitest) wired to `assets/scripts/core`, plus a
|
||||
`core` purity guard and a strict typecheck
|
||||
|
||||
### M1 — Rules core `[ ]`
|
||||
### M1 — Rules core `[x]`
|
||||
- [x] Seeded RNG and shuffle
|
||||
- [ ] `Suit`, `Rank`, `Card`, 36-card deck
|
||||
- [ ] `GameState`: hands, deck, trump, table slots, discard, phase, turn order
|
||||
- [ ] First-attacker selection per GAMEPLAY.md (lowest trump → lowest card → random)
|
||||
- [ ] Legal action generation: `Attack`, `Defend`, `Take`, `Pass`
|
||||
- [ ] Turn resolution: beat-all / take, discard, draw order, player elimination
|
||||
- [ ] End conditions and loser ("fool") determination
|
||||
- [ ] Unit tests covering every rule clause, including the add-card limits
|
||||
- [x] `Suit`, `Rank`, `Card`, 36-card deck
|
||||
- [x] `GameState`: hands, deck, trump, table slots, discard, phase, turn order
|
||||
- [x] First-attacker selection per GAMEPLAY.md (lowest trump → lowest card → random)
|
||||
- [x] Legal action generation: `Attack`, `Defend`, `Take`, `Pass`
|
||||
- [x] Turn resolution: beat-all / take, discard, draw order, player elimination
|
||||
- [x] End conditions and loser ("fool") determination
|
||||
- [x] Unit tests covering every rule clause, including the add-card limits
|
||||
|
||||
### M2 — Bot and headless match runner `[ ]`
|
||||
- [ ] `PlayerView` projection — a bot sees only what a player legitimately sees
|
||||
|
||||
Reference in New Issue
Block a user