shortdeck1.0

This commit is contained in:
2025-09-30 18:09:49 +08:00
commit ee95b8e049
24 changed files with 532 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
from __future__ import annotations
from shortdeck_server.arena_adapter import ArenaGame
def test_join_and_actions():
g = ArenaGame(starting_stack=100, max_players=3)
pid0 = g.join_game("aa")
pid1 = g.join_game("bb")
assert pid0 == 0
assert pid1 == 1
state = g.info()
assert state["stacks"] == [100, 100]
try:
g.apply_action(1, "fold")
except ValueError as e:
assert "not your turn" in str(e)
g.apply_action(0, "check")
assert g.current_turn == 1
g.apply_action(1, "bet", 10)
assert g.pot == 10
assert g.stacks[1] == 90
assert g.history[-1]["action"] == "bet"