gonzo_card_games.RatScrew module
- class gonzo_card_games.RatScrew.Game[source]
Bases:
CardGameTemplateClass to run and manage gameplay state of Rat Screw card game
- property game_winner: int | None
Return the index of the player who won the most recently completed game, or None if no winner yet.
- class gonzo_card_games.RatScrew.Player(invalid_action_keys: set = None)[source]
Bases:
objectManage player state of participant in game of rat screw
- play_card() Card[source]
Play a card from player’s card stack
Returns
Card to be played from the player’s card stack
- property play_key: str
Return value of the key that player uses for playing cards
- property slap_key: str
Return value of the key that player uses for slapping the card stack
- take_round_stack(round_stack: RoundCardStack) None[source]
Remove cards from round stack and add it to player’s card stack
Parameters
- round_stack: RoundCardStack
The round stack that is being added to the player’s card stack
- class gonzo_card_games.RatScrew.RoundCardStack[source]
Bases:
objectClass to manage the stack of cards played during a round of Rat Screw
- add_penalty_card(card: Card) None[source]
Add penalty cards to the penalty stack
Parameters
- card: Card
Card to be added to the penalty stack.
- add_played_card(card: Card) None[source]
Play a card onto the round stack and update face card countdown if necessary
Parameters
- card: Card
The card to be played onto the round stack.
- has_stack_been_won() bool[source]
Determine if stack has been won by a player
Returns
Boolean indicating whether the stack has been won
- is_valid_slap() bool[source]
Determine if slapping current stack is valid
Returns
Boolean indicating whether the stack is in a valid slap state
- property need_face_card: bool
Return round stack state of needing a face card added to it