M2: бот и headless-прогон матчей
- PlayerView: проекция состояния, в которой боту видно только то, что видно живому игроку (своя рука, стол, размеры чужих рук, счётчики) - BasicBot: политика из GAMEPLAY.md, полностью детерминированная - Match: обёртка с состоянием и подпиской на события (её же возьмёт UI) - runMatch: прогон матча без движка и без таймеров - soak-тесты: 3500 полных матчей (боты и случайные легальные ходы, 2-4 игрока), инварианты состояния проверяются после каждого действия - npm run stats:bot — распределение исходов самоигры Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Action } from '../rules/Action';
|
||||
import { PlayerView } from './PlayerView';
|
||||
|
||||
/**
|
||||
* A decision maker for one seat.
|
||||
*
|
||||
* Synchronous and pure: given the same view, a bot returns the same action.
|
||||
* Any pacing — the pause that makes a bot feel like it is thinking — belongs to
|
||||
* the presentation layer, not here.
|
||||
*/
|
||||
export interface Bot {
|
||||
readonly name: string;
|
||||
/** Must return one of `view.legalActions`. */
|
||||
decide(view: PlayerView): Action;
|
||||
}
|
||||
Reference in New Issue
Block a user