Open
Conversation
Introduce a BotPlayer ABC that extends Player with an is_bot flag and two abstract strategy methods: decide_bet() and decide_action(). This provides the extension point for creating bots with custom blackjack strategies. Also add is_bot = False to the base Player class to allow distinguishing human players from bots. https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
Implement a concrete BotPlayer that uses a simple dealer-aware strategy: - Always bets the minimum amount - Against a weak dealer card (2-6): stands on 12+ to let the dealer bust - Against a strong dealer card (10/face/ace): hits below 17 - Against a moderate dealer card (7-9): hits below 17 https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
During the BETTING phase, bots automatically place bets via their decide_bet() strategy method. During the PLAYING phase, if the current player is a bot, their decide_action() method is called to determine whether to hit or stand, and the action is executed immediately. Human player behavior is unchanged — they still get turn reminders and interact via Redis messages. https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
Add add_bot() and remove_bot() methods to Casino for managing bot
players in games. Bots are created from a registry of available bot
types (currently just 'simple'). A new 'bot_action' event type in the
Redis message protocol allows adding/removing bots via pub/sub with
messages like:
{"event_type": "bot_action", "game_id": "...",
"action": "add_bot", "bot_name": "...", "bot_type": "simple"}
https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
Test coverage for: - BotPlayer ABC cannot be instantiated directly - Player.is_bot vs BotPlayer.is_bot identity - SimpleBlackjackBot strategy decisions (strong/weak/moderate dealer cards) - Bot auto-betting during BETTING phase tick - Bot auto-playing during PLAYING phase tick - Bot hitting on low scores across multiple ticks - Complete bot game lifecycle (WAITING through BETWEEN_HANDS) - Bot and human player coexistence in the same game - Casino.add_bot/remove_bot management methods - BOT_TYPES registry validation https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
Add 'addbot' and 'removebot' commands to the CLI client: - addbot [name] [type] — adds a bot to the current game (name and type are optional, defaults to auto-generated name and 'simple' strategy) - removebot <name> — removes a bot from the current game Both commands send bot_action events via Redis to the server. https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc
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.
Introduce a BotPlayer ABC that extends Player with an is_bot flag and
two abstract strategy methods: decide_bet() and decide_action(). This
provides the extension point for creating bots with custom blackjack
strategies. Also add is_bot = False to the base Player class to allow
distinguishing human players from bots.
https://claude.ai/code/session_01YTW8VfUgRq4x174iQYoBJc