Add CPU opponents and a table type selector (cash only / friends / CPU)

- Create screen: choose キャッシュオンリー (real cards, chips only), 友人戦
  (server deals and settles) or CPU戦 (友人戦 plus 1–8 CPU players); replaces
  the card toggle. The lobby shows each table's type
- Poker AI written from scratch (server/ai.js, no libraries): fast 7-card
  evaluator (checked against bestHand), Monte Carlo equity, and decisions from
  hand rank, pot odds, raise count, opponents and a per-CPU style (aggression,
  bluff rate); continuation bets via the last aggressor. It never sees other
  players' hole cards
- CPU seats: think time of 0.7–1.8s (faster when no human is left in the hand),
  automatic rebuy, never the host, no new hand unless a human is playing,
  re-think after pause
- Play UI: robot avatars and a "考えています…" status for CPU turns
- Tests for the evaluator, equity, legality of AI actions and CPU tables

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-17 16:55:25 +09:00
1 parent 66907345ff
commit 0d3a054f0d
12 files changed
+550 -46

No files matched your search

+22 -9
View File
@@ -23,6 +23,28 @@
<button type="button" class="icon-btn" id="reroll" aria-label="別の名前にする">🎲</button>
</div>
<div class="label" id="mode-label">テーブルの種類</div>
<div class="segmented" role="radiogroup" aria-labelledby="mode-label">
<label><input type="radio" name="mode" value="chips" checked><span>キャッシュ<br>オンリー</span></label>
<label><input type="radio" name="mode" value="friends"><span>友人戦</span></label>
<label><input type="radio" name="mode" value="cpu"><span>CPU戦</span></label>
</div>
<div class="hint" id="mode-hint"></div>
<div id="cpu-options" hidden>
<div class="label" id="cpu-label">CPU の人数</div>
<div class="segmented numbers" role="radiogroup" aria-labelledby="cpu-label">
<label><input type="radio" name="cpu-count" value="1"><span>1</span></label>
<label><input type="radio" name="cpu-count" value="2"><span>2</span></label>
<label><input type="radio" name="cpu-count" value="3"><span>3</span></label>
<label><input type="radio" name="cpu-count" value="4"><span>4</span></label>
<label><input type="radio" name="cpu-count" value="5" checked><span>5</span></label>
<label><input type="radio" name="cpu-count" value="6"><span>6</span></label>
<label><input type="radio" name="cpu-count" value="7"><span>7</span></label>
<label><input type="radio" name="cpu-count" value="8"><span>8</span></label>
</div>
</div>
<label for="stack">開始スタック</label>
<input id="stack" type="number" inputmode="numeric" min="10" step="1" value="1000">
@@ -49,15 +71,6 @@
</div>
<div class="schedule" id="schedule" hidden></div>
<div class="switch-row">
<span>カードを配る</span>
<label class="switch">
<input id="cards" type="checkbox" aria-label="カードを配る">
<span></span>
</label>
</div>
<div class="hint" id="cards-hint">オフ: 実物のカードで遊び、ショーダウンの勝者はホストが選ぶ</div>
<div class="error-text" id="error"></div>
<button class="btn btn-orange btn-block mt-8" id="submit" type="submit">テーブルを作成</button>
</form>