Add pi-texas-holdem: Texas Hold'em on an oval terminal table - #1
Open
geminixiang wants to merge 9 commits into
Open
Add pi-texas-holdem: Texas Hold'em on an oval terminal table#1geminixiang wants to merge 9 commits into
geminixiang wants to merge 9 commits into
Conversation
Adds a new Pi extension with a tested no-limit Hold'em engine (deck, hand evaluator, betting rounds, side pots), a box-drawing oval table renderer, and WebSocket host/join networking for playing over the LAN. Identity is just the machine hostname, and the table shows today's token usage. /poker bots plays solo against simple bots right away; /poker host and /poker join wire up multiplayer. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015iGzsop5jB18LBJk4EtVko
Chat rides the existing host-authoritative WebSocket protocol: a new "chat"/"chatMessage"/"chatHistory" message trio, a bounded per-room history with replay for late joiners, and per-connection rate limiting. Game events (blinds, folds, calls, raises, showdown) are mirrored into the same feed as system messages, so the small terminal panel doubles as chat and action log instead of needing two. Chat text is rendered straight into other players' terminals, so it's sanitized before broadcast: ANSI/OSC escape sequences and other control characters are stripped, newlines collapsed, length capped. Covered by dedicated sanitize + host/client integration tests. UI: press / to open a compose line inside the table overlay, Enter to send, Esc to cancel, without colliding with the single-key action shortcuts (f/c/r/a). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015iGzsop5jB18LBJk4EtVko
- /poker host now requires --i-know flag; first run prints the disclaimer (host can see hole cards, do not use for money) instead of a modal we don't have a native prompt for. - Join flow prints a trust warning before connecting. - Client distinguishes "never connected" from "host went away mid-game" and surfaces a plain host-offline notice + closes the room. Follow-ups (separate diff): display-name validation, grace-period reconnect toast with countdown, render three cleanups. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extract reusable sessions and runtime-neutral game logic, add a personal Cloudflare Worker with Durable Object rooms, and wire local/create/join terminal flows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new Pi extension with a tested no-limit Hold'em engine (deck,
hand evaluator, betting rounds, side pots), a box-drawing oval table
renderer, and WebSocket host/join networking for playing over the LAN.
Identity is just the machine hostname, and the table shows today's
token usage. /poker bots plays solo against simple bots right away;
/poker host and /poker join wire up multiplayer.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_015iGzsop5jB18LBJk4EtVko