crapssim.bet
Attributes
Classes
dict() -> new empty dictionary |
|
Base class for protocol classes. |
|
Base class for protocol classes. |
|
Metaclass for defining Abstract Base Classes (ABCs). |
|
A generic bet for the craps table |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A _SimpleBet has fixed winning and losing numbers and payout ratio that |
|
A generic bet for the craps table |
|
A generic bet for the craps table |
|
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself. |
|
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself. |
|
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself. |
|
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself. |
Module Contents
- crapssim.bet.ALL_DICE_NUMBERS
- class crapssim.bet.TableSettings
Bases:
TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
- ATS_payouts: dict[str, int]
- field_payouts: dict[int, int]
- fire_payouts: dict[int, int]
- max_odds: dict[int, int]
- max_dont_odds: dict[int, int]
- class crapssim.bet.Table
Bases:
Protocol
Base class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- dice: crapssim.dice.Dice
- point: crapssim.point.Point
- settings: TableSettings
- class crapssim.bet.Player
Bases:
Protocol
Base class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- class crapssim.bet.BetResult
- amount: float
- remove: bool
- property won: bool
- property lost: bool
- property pushed: bool
- property bankroll_change: float
- class crapssim.bet._MetaBetABC
Bases:
abc.ABCMeta
Metaclass for defining Abstract Base Classes (ABCs).
Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
- __repr__()
- class crapssim.bet.Bet(amount: SupportsFloat)
Bases:
abc.ABC
A generic bet for the craps table
- Parameters:
amount (SupportsFloat) – Wagered amount for the bet
- amount
Wagered amount for the bet
- Type:
float
- amount: float
- is_allowed(player: Player) bool
Checks whether the bet is allowed to be placed on the given table. May depend on the player’s bets also (e.g. for odds bets).
- Parameters:
player
- Returns:
True if the bet is allowed, otherwise false.
- Return type:
bool
- property _placed_key: Hashable
- property _hash_key: Hashable
- __eq__(other: object) bool
- __hash__() int
- __repr__() str
- __radd__(other)
- __rsub__(other)
- class crapssim.bet._WinningLosingNumbersBet(amount: SupportsFloat)
Bases:
Bet
,abc.ABC
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- class crapssim.bet._SimpleBet(amount: SupportsFloat)
Bases:
_WinningLosingNumbersBet
,abc.ABC
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = []
- losing_numbers: list[int] = []
- payout_ratio: int = 1
- class crapssim.bet.PassLine(amount: SupportsFloat)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- class crapssim.bet.Come(amount: SupportsFloat, number: int | None = None)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- is_allowed(player: Player) bool
Checks whether the bet is allowed to be placed on the given table. May depend on the player’s bets also (e.g. for odds bets).
- Parameters:
player
- Returns:
True if the bet is allowed, otherwise false.
- Return type:
bool
- property _placed_key: Hashable
- __repr__() str
- class crapssim.bet.DontPass(amount: SupportsFloat)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- class crapssim.bet.DontCome(amount: SupportsFloat, number: int | None = None)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- is_allowed(player: Player) bool
Checks whether the bet is allowed to be placed on the given table. May depend on the player’s bets also (e.g. for odds bets).
- Parameters:
player
- Returns:
True if the bet is allowed, otherwise false.
- Return type:
bool
- property _placed_key: Hashable
- __repr__() str
- class crapssim.bet.Odds(base_type: Type[PassLine | DontPass | Come | DontCome], number: int, amount: float)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- base_type
- number
- property light_side: bool
- property dark_side: bool
- is_allowed(player: Player) bool
Checks whether the bet is allowed to be placed on the given table. May depend on the player’s bets also (e.g. for odds bets).
- Parameters:
player
- Returns:
True if the bet is allowed, otherwise false.
- Return type:
bool
- property _placed_key: Hashable
- __repr__()
- class crapssim.bet.Place(number: int, amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- payout_ratios
- losing_numbers: list[int] = [7]
- number
- payout_ratio
- winning_numbers
- property _placed_key: Hashable
- __repr__() str
- class crapssim.bet.Field(amount: SupportsFloat)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- winning_numbers = [2, 3, 4, 9, 10, 11, 12]
- losing_numbers = [5, 6, 7, 8]
- class crapssim.bet.CAndE(amount: SupportsFloat)
Bases:
_WinningLosingNumbersBet
A _WinningLosingNumbersBet has winning numbers, losing numbers, and payout ratios (possibly depending on the table) from which the result can be calculated.
- winning_numbers: list[int] = [2, 3, 11, 12]
- losing_numbers: list[int]
- class crapssim.bet.Any7(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [7]
- losing_numbers: list[int]
- payout_ratio: int = 4
- class crapssim.bet.Two(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [2]
- losing_numbers: list[int]
- payout_ratio: int = 30
- class crapssim.bet.Three(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [3]
- losing_numbers: list[int]
- payout_ratio: int = 15
- class crapssim.bet.Yo(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [11]
- losing_numbers: list[int]
- payout_ratio: int = 15
- class crapssim.bet.Boxcars(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [12]
- losing_numbers: list[int]
- payout_ratio: int = 30
- class crapssim.bet.AnyCraps(amount: SupportsFloat)
Bases:
_SimpleBet
A _SimpleBet has fixed winning and losing numbers and payout ratio that can be known at instantiation and don’t depend on the table.
- winning_numbers: list[int] = [2, 3, 12]
- losing_numbers: list[int]
- payout_ratio: int = 7
- class crapssim.bet.HardWay(number: int, amount: SupportsFloat)
Bases:
Bet
A generic bet for the craps table
- Parameters:
amount (SupportsFloat) – Wagered amount for the bet
- amount
Wagered amount for the bet
- Type:
float
- payout_ratios
- number
- payout_ratio
- property winning_result: list[int]
- property _placed_key: Hashable
- __repr__() str
- class crapssim.bet.Fire(amount: float)
Bases:
Bet
A generic bet for the craps table
- Parameters:
amount (SupportsFloat) – Wagered amount for the bet
- amount
Wagered amount for the bet
- Type:
float
- points_made: set[int]
- ended: bool = False
- class crapssim.bet._ATSBet(amount: float)
Bases:
Bet
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself.
- numbers: list[int] = []
- type: str = '_ATSBet'
- rolled_numbers: set[int]
- class crapssim.bet.All(amount: float)
Bases:
_ATSBet
Class representing ATS (All, Tall, Small) bets, not a usable bet by itself.
- type: str = 'all'
- numbers: list[int] = [2, 3, 4, 5, 6, 8, 9, 10, 11, 12]