crapssim.bet

Bet models and payout logic for the craps simulation engine.

Classes

BetResult

Represents the outcome of a bet

Bet

A generic bet for the craps table.

_WinningLosingNumbersBet

A bet that has winning numbers, losing numbers, and payout ratios

_SimpleBet

A bet that has fixed winning and losing numbers and payout ratio

PassLine

Pass Line bet in craps.

Come

Come bet in craps.

DontPass

Don't Pass bet in craps.

DontCome

Don't Come bet in craps.

Odds

Odds bet (for PassLine, DontPass, Come, DontCome or Put) in craps.

_BoxNumberBet

Shared logic for single box-number bets (Place, Buy, Lay, Put).

Put

Flat line bet on a box number; point must be ON and odds obey table policy.

Place

A bet on a specific number being rolled before a 7.

Buy

True-odds bet on 2/3/4/5/6/8/9/10/11/12 that charges vig per table policy.

Lay

True-odds bet against 2/3/4/5/6/8/9/10/11/12, paying if 7 arrives first.

Field

Field bet in craps.

CAndE

Craps and Eleven (C & E) bet in craps.

Any7

Any 7 bet (also known as Big Red) in craps.

Two

Two (Snake Eyes) bet in craps.

Three

Three bet in craps.

Yo

Yo (Eleven) bet in craps.

Boxcars

Boxcars (Midnight) bet in craps.

AnyCraps

Any Craps bet in craps.

Horn

One-roll bet split across 2, 3, 11, and 12; loses on all other totals.

World

One-roll bet covering Horn numbers plus 7; pays break-even on 7.

Big6

Even-money bet that wins on 6 before 7.

Big8

Even-money bet that wins on 8 before 7.

HardWay

Hard Way bet (on 4, 6, 8, or 10) in craps.

Hop

Hop bet in craps.

Fire

Fire bet in craps.

All

All bet (part of All/Tall/Small bets) in craps.

Tall

Tall bet (part of All/Tall/Small bets) in craps.

Small

Small bet (part of All/Tall/Small bets) in craps.

Module Contents

class crapssim.bet.BetResult

Represents the outcome of a bet

This class is used by all Bets for consistency in determining whether the bet won, lost or pushed. It provides properties to analyze the bet outcome and its impact on a bankroll.

amount: float

The monetary value representing the bet outcome.

remove: bool

Flag indicating whether this bet result should be removed from table.

bet_amount: float = 0

The monetary value of the original bet size. Needed only for bets that push and return the wager to the player. Default is zero for quick results that can define wins and losses by comparing against zero.

classmethod win(*, profit: float, bet_amount: float, remove: bool) BetResult

A winning bet.

Parameters:
  • profit – Winnings above the wager (payout only, principal excluded).

  • bet_amount – The original wager.

  • remove – Whether the wager comes off the table (True) or keeps working (False). This flag alone decides whether the returned principal is credited to the bankroll; see bankroll_change.

classmethod lose(*, cost: float, bet_amount: float) BetResult

A losing bet, removed from the table.

Parameters:
  • cost – Amount lost. Equal to the wager for most bets, but may exceed it when an upfront vig was paid.

  • bet_amount – The original wager.

classmethod push(bet_amount: float) BetResult

A tie: the wager is returned to the player and the bet removed.

classmethod no_change(bet_amount: float) BetResult

No action this roll: the bet does nothing and stays on the table.

property won: bool

Returns True if the bet won (amount more than initial bet).

property lost: bool

Returns True if the bet lost (negative amount).

property pushed: bool

Returns True if the bet tied (zero amount).

property bankroll_change: float

Cash credited to the bankroll for this result.

The wager was already deducted when the bet was placed, so:

  • loss or no-action (amount <= 0): nothing is credited.

  • non-removing win: the wager stays working on the table, so only the net profit is credited.

  • removing win or push: the wager comes off the table, so the full returned amount (principal plus any winnings) is credited.

class crapssim.bet.Bet(amount: SupportsFloat)

Bases: abc.ABC

A generic bet for the craps table.

The high-level class that defines most of the core bet methods. All bets will be a subclass of this.

amount: float

Wagered amount for the bet.

abstractmethod get_result(table: Table) BetResult

Core bet logic that determines the result.

This determines the ultimate amount and whether the bet needs to be removed, which is indicated with a BetResult object.

cost(table: Table) float

Total bankroll required to put this bet in action on table.

update_number(table: Table)

Update the bet’s number, if applicable

This method is required by Come and DontCome bets to update their number after the first roll. Since this method is used by the Table, it defaults to doing nothing for a generic bet.

is_removable(table: Table) bool

Checks whether the bet is removable. May depend on the table conditions (e.g. if point is On).

Returns:

True if the bet is removable, otherwise false.

Return type:

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).

Returns:

True if the bet is allowed, otherwise false.

Return type:

bool

copy() Bet

Create a fresh copy of this bet

property _placed_key: Hashable
property _hash_key: Hashable
__eq__(other: object) bool
__hash__() int
__repr__() str
__add__(other: Bet) Bet
__radd__(other)
__sub__(other: Bet) Bet
__rsub__(other)
__str__() str
class crapssim.bet._WinningLosingNumbersBet(amount: SupportsFloat)

Bases: Bet, abc.ABC

A bet that has winning numbers, losing numbers, and payout ratios

These values (possibly depending on the table) are used to calculate the result.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

abstractmethod get_winning_numbers(table: Table) list[int]

Returns the winnings numbers, based on table features and ruleset.

abstractmethod get_losing_numbers(table: Table) list[int]

Returns the losing numbers, based on table features and ruleset.

get_push_numbers(table: Table) list[int]

Returns the push numbers, based on table features and ruleset.

abstractmethod get_payout_ratio(table: Table) float

Returns the payout ratio (X to 1), based on table features.

class crapssim.bet._SimpleBet(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet, abc.ABC

A bet that has fixed winning and losing numbers and payout ratio

Essentially, the numbers and payout ratio can be known at instantiation and don’t depend on the table.

winning_numbers: list[int] = []

Winning numbers for the bet

losing_numbers: list[int] = []

Losing numbers for the bet

payout_ratio: int = 1

Payout ratio for the bet

get_winning_numbers(table: Table) list[int]

Returns the winning numbers (table not used here)

get_losing_numbers(table: Table) list[int]

Returns the losing numbers (table not used here)

get_payout_ratio(table: Table) float

Returns the payout ratio (table not used here)

class crapssim.bet.PassLine(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

Pass Line bet in craps.

A bet where the player wins if the first roll is a come-out winner for the active ruleset, loses if the first roll is a come-out loser for the active ruleset, and establishes a point number for subsequent rolls. Once a point is set, the player wins by rolling the point number again before rolling a 7. Pays 1 to 1.

get_winning_numbers(table: Table) list[int]

Winning numbers are come-out winners before a point is set, and the current point number after it is established. Uses table to determine the point number and status.

For regular craps, come-out winners are 7, 11. For crapless craps, the only come-out winner is 7.

get_losing_numbers(table: Table) list[int]

Losing numbers are come-out losers before a point is set, and the table’s point loser numbers after it is established. Uses table to determine the point number and status.

For regular craps, come-out losers are 2, 3, 12. For crapless craps, there are no come-out losers.

get_payout_ratio(table: Table) float

PassLine always pays out 1:1

is_removable(table: Table) bool

PassLine is removable if the point is off

Returns:

True if the bet is removable, otherwise false.

Return type:

bool

is_allowed(player: Player) bool

PassLine is allowed if the point if off

Returns:

True if the bet is allowed, otherwise false.

Return type:

bool

class crapssim.bet.Come(amount: SupportsFloat, number: int | None = None)

Bases: _WinningLosingNumbersBet

Come bet in craps.

Similar to the Pass Line bet, but can be placed after a point is established. The first roll determines the Come bet’s point number, but also wins on come-out winners and loses on come-out losers. The bet wins in subsequent rolls if the point number is rolled before a 7, and loses if a 7 is rolled before the point number. Pays 1 to 1.

get_winning_numbers(table: Table) list[int]

Winning numbers are come-out winners before the number is set, and the number after it is set. Number is stored within the bet.

get_losing_numbers(table: Table) list[int]

Losing numbers are come-out losers before the number is set, and 7 after it is set. Number is stored within the bet.

get_payout_ratio(table: Table) float

Come always pays out 1:1

update_number(table: Table)

Update the bet’s number to the first number rolled if it’s in the valid point numbers for the active ruleset.

is_removable(table: Table) bool

Come bet is removable is it’s number has not been established yet (first roll).

Returns:

True if the bet is removable, otherwise false.

Return type:

bool

is_allowed(player: Player) bool

Return whether this Come bet is legal and can be placed for the current table state.

Returns:

True when the table point is on and the optional numbered Come target is valid for the active ruleset.

Return type:

bool

copy() Bet

Create a fresh copy of this bet with no number

property _placed_key: Hashable
__repr__() str
__str__() str
class crapssim.bet.DontPass(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

Don’t Pass bet in craps.

The opposite of the Pass Line bet. The player wins if the first roll is 2 or 3, pushes on 12, and loses if the first roll is 7 or 11. After a point is established, the player wins by rolling a 7 before the point number. Bet pays 1 to 1.

get_winning_numbers(table: Table) list[int]

Winnings numbers are 2 or 3 before point is set, and 7 after point is set. Uses table to determine the point number and status.

get_losing_numbers(table: Table) list[int]

Losing numbers are 7 or 11 before point is set, and table point number after point is set. Uses table to determine the point number and status.

get_push_numbers(table: Table) list[int]

Returns the push numbers, based on table features and ruleset.

get_payout_ratio(table: Table) float

Don’t pass always pays out 1:1

is_allowed(player: Player) bool

Return whether this Don’t Pass bet is legal and can be placed for the current table state.

Returns:

True if the point is off and the table rules allow Don’t Pass.

Return type:

bool

class crapssim.bet.DontCome(amount: SupportsFloat, number: int | None = None)

Bases: _WinningLosingNumbersBet

Don’t Come bet in craps.

Similar to the Don’t Pass bet, but can be placed after a point is established, but also wins on 2, 3, pushes on 12, and loses on 7 or 11. The first roll determines the Don’t Come bet’s number. The bet wins in subsequent rolls if a 7 is rolled before the point number, and loses if the number is rolled before a 7. Pays 1 to 1.

get_winning_numbers(table: Table) list[int]

Returns the winnings numbers, based on table features and ruleset.

get_losing_numbers(table: Table) list[int]

Returns the losing numbers, based on table features and ruleset.

get_push_numbers(table: Table) list[int]

Returns the push numbers, based on table features and ruleset.

get_payout_ratio(table: Table) float

Don’t Come always pays out 1:1

update_number(table: Table)

Update the bet’s number, if applicable

This method is required by Come and DontCome bets to update their number after the first roll. Since this method is used by the Table, it defaults to doing nothing for a generic bet.

is_allowed(player: Player) bool

Return whether this Don’t Come bet is legal and can be placed for the current table state.

Returns:

True if the point is on and the table rules allow Don’t Come.

Return type:

bool

copy() Bet

Create a fresh copy of this bet, with no number

property _placed_key: Hashable
__repr__() str
__str__() str
class crapssim.bet.Odds(base_type: type[PassLine | DontPass | Come | DontCome | Put], number: int, amount: float, always_working: bool | None = None)

Bases: _WinningLosingNumbersBet

Odds bet (for PassLine, DontPass, Come, DontCome or Put) in craps.

A supplementary bet placed behind Pass Line, Don’t Pass, Come, or Don’t Come bets. Offers true odds payouts, meaning the house has no edge. The payout varies depending on the point number and whether it’s a “light side” (Pass/Come/Put) or “dark side” (Don’t Pass/Don’t Come) bet.

light_ratios

True-odds payouts (X to 1) for light-side (Pass/Come/Put) odds.

dark_ratios

True-odds payouts (X to 1) for dark-side (Don’t Pass/Don’t Come) odds.

base_type
number
always_working = None
property light_side: bool

Whether this odds bet follows pass/come-style winning logic.

property dark_side: bool

Whether this odds bet follows dont-pass/dont-come logic.

is_working_on_come_out() bool

Whether the bet resolves while the point is off.

Defaults to false for all base_type bets except DontCome, but an explicit always_working set on the bet overrides it.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

get_winning_numbers(table: Table) list[int]

Returns the winnings numbers, based on table features and ruleset.

get_losing_numbers(table: Table) list[int]

Returns the losing numbers, based on table features and ruleset.

get_payout_ratio(table: Table) float

Returns the payout ratio (X to 1), based on table features.

is_allowed(player: Player) bool

Return whether the odds amount is legal and can be placed for the current table state.

Returns:

True if bet number is valid for the active ruleset, and amount is within max odds.

Return type:

bool

get_max_odds(table: Table) float

Return table-specific maximum odds multiple for this point.

base_amount(player: Player) float

Return total base-bet amount this odds bet is attached to.

copy() Bet

Create a fresh copy of this bet

_get_always_working_repr() str

Since the default is None, only need to print when explicitly set.

property _placed_key: Hashable
__repr__()
__str__() str
class crapssim.bet._BoxNumberBet(number: int, amount: SupportsFloat, always_working: bool | None = None)

Bases: _SimpleBet, abc.ABC

Shared logic for single box-number bets (Place, Buy, Lay, Put).

Each is a wager on a box number (or against it, for Lay) that may be working or off on the come-out, controlled by the table’s come-out working policy or an explicit always_working override on the bet.

number
always_working = None
abstractmethod _set_payout() None

Set payout_ratio and the number-based winning/losing numbers.

is_allowed(player: Player) bool

Return whether this bet’s number is valid for the active ruleset.

is_working_on_come_out(table: Table) bool

Whether the bet resolves while the point is off.

Defaults to the table’s come-out working policy, but an explicit always_working set on the bet overrides it.

_off_come_out(table: Table) bool

True when the point is off and the bet is not working, so a roll of its number or 7 leaves it inactive instead of resolving.

copy() Bet

Create a fresh copy of this bet.

property _placed_key: Hashable
class crapssim.bet.Put(number: int, amount: SupportsFloat, always_working: bool | None = None)

Bases: _BoxNumberBet

Flat line bet on a box number; point must be ON and odds obey table policy.

losing_numbers: list[int] = [7]

Losing numbers for the bet

_set_payout() None

Set payout_ratio and the number-based winning/losing numbers.

is_allowed(player: Player) bool

Return whether this Put bet is legal: the point must be on and the number valid for the active ruleset.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

__repr__() str
__str__() str
class crapssim.bet.Place(number: int, amount: SupportsFloat, always_working: bool | None = None)

Bases: _BoxNumberBet

A bet on a specific number being rolled before a 7. Each number has a different payout ratio reflecting its probability of being rolled. Remains active until the number or a 7 is rolled.

Place bet (on 4, 5, 6, 8, 9, or 10) in craps. Place bet (on 2, 3, 4, 5, 6, 8, 9, 10, 11, or 12) in crapless craps.

payout_ratios

11 to 2 on (2, 12), 11 to 4 on (3, 11), 9 to 5 on (4, 10), 7 to 5 on (5, 9), and 7 to 6 on (6, 8).

Type:

Stores the place bet payouts

losing_numbers: list[int] = [7]

Losing numbers for the bet

_set_payout() None

Set payout_ratio and the number-based winning/losing numbers.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

__repr__() str
__str__() str
class crapssim.bet.Buy(number: int, amount: SupportsFloat, always_working: bool | None = None)

Bases: _BoxNumberBet

True-odds bet on 2/3/4/5/6/8/9/10/11/12 that charges vig per table policy.

Vig (commission) may be taken on the win or upfront based on vig_paid_on_win.

true_odds
losing_numbers: list[int] = [7]

Losing numbers for the bet

_set_payout() None

Set payout_ratio and the number-based winning/losing numbers.

vig(table: Table) float

Compute buy-bet commission based on table vig policy.

cost(table: Table) float

Total bankroll required to put this bet in action on table.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

__repr__() str
__str__() str
class crapssim.bet.Lay(number: int, amount: SupportsFloat, always_working: bool | None = None)

Bases: _BoxNumberBet

True-odds bet against 2/3/4/5/6/8/9/10/11/12, paying if 7 arrives first.

Commission may be taken on the win or upfront based on vig_paid_on_win. Note that the vig is taken on the amount won, not the bet amount, since this is typically done in a casino (e.g. Laying the 4 for $40, which pays $20, would have a $1 vig).

true_odds
winning_numbers: list[int] = [7]

Winning numbers for the bet

_set_payout() None

Set payout_ratio and the number-based winning/losing numbers.

vig(table: Table) float

Compute lay-bet commission based on potential gross win.

cost(table: Table) float

Total bankroll required to put this bet in action on table.

get_result(table: Table) BetResult

Core bet logic that determines the result.

Wins are based on having dice total in the winning numbers (which may depend on the table), which will pay the payout_ratio times the bet amount plus the original bet amount back. Losses happen when dice total is in the losing numbers, which result in a loss of the original bet amount. Otherwise the bet stays on the table.

This is the hot path of the simulator: it runs for every bet on every roll, so it deliberately avoids come-out (“working”) handling. Bets that can be off on the come-out (Odds, Place/Buy/Lay/Put) apply that guard in their own get_result before delegating here.

__repr__() str
__str__() str
class crapssim.bet.Field(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

Field bet in craps.

A one-roll bet that wins if the next roll is 2, 3, 4, 9, 10, 11, or 12. Loses if 5, 6, 7, or 8 are rolled. Offers variable payouts for specific numbers as defined in the table settings (TableSettings(), “field_payouts”:, which default to 2 to 1 for (2, 12) and 1 to 1 otherwise.

winning_numbers = [2, 3, 4, 9, 10, 11, 12]

Field wins on 2, 3, 4, 9, 10, 11, or 12

losing_numbers = [5, 6, 7, 8]

Field loses on 5, 6, 7, or 8

get_winning_numbers(table: Table) list[int]

Returns the winning numbers (table not used here)

get_losing_numbers(table: Table) list[int]

Returns the losing numbers (table not used here)

get_payout_ratio(table: Table) float

Returns the payout ratio (X to 1) based on table settings (TableSettings(), “field_payouts”:

class crapssim.bet.CAndE(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

Craps and Eleven (C & E) bet in craps.

A one-roll bet that wins if the next roll is 2, 3, 11, or 12. Offers different payout ratios for different winning numbers: - 3 to 1 for 2, 3, and 12 - 7 to 1 for 11 Loses on all other numbers.

winning_numbers: list[int] = [2, 3, 11, 12]

Winning numbers are (2, 3, 11, 12).

losing_numbers: list[int]

Losing numbers are anything besides (2, 3, 11, 12).

get_winning_numbers(table: Table) list[int]

Returns the winning numbers (table not used here)

get_losing_numbers(table: Table) list[int]

Returns the losing numbers (table not used here)

get_payout_ratio(table: Table) float

C & E pays out 3 to 1 for (2, 3, 12) and 7 to 1 for (11).

class crapssim.bet.Any7(amount: SupportsFloat)

Bases: _SimpleBet

Any 7 bet (also known as Big Red) in craps.

A one-roll bet that wins only if the next roll is 7. Offers a 4 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [7]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except 7.

payout_ratio: int = 4

Payout ratio for the bet

class crapssim.bet.Two(amount: SupportsFloat)

Bases: _SimpleBet

Two (Snake Eyes) bet in craps.

A one-roll bet that wins only if the next roll is 2. Offers a 30 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [2]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except 2.

payout_ratio: int = 30

Payout ratio for the bet

class crapssim.bet.Three(amount: SupportsFloat)

Bases: _SimpleBet

Three bet in craps.

A one-roll bet that wins only if the next roll is 3. Offers a 15 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [3]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except 3.

payout_ratio: int = 15

Payout ratio for the bet

class crapssim.bet.Yo(amount: SupportsFloat)

Bases: _SimpleBet

Yo (Eleven) bet in craps.

A one-roll bet that wins only if the next roll is 11. Offers a 15 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [11]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except 11.

payout_ratio: int = 15

Payout ratio for the bet

class crapssim.bet.Boxcars(amount: SupportsFloat)

Bases: _SimpleBet

Boxcars (Midnight) bet in craps.

A one-roll bet that wins only if the next roll is 12. Offers a 30 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [12]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except 12.

payout_ratio: int = 30

Payout ratio for the bet

class crapssim.bet.AnyCraps(amount: SupportsFloat)

Bases: _SimpleBet

Any Craps bet in craps.

A one-roll bet that wins if the next roll is 2, 3, or 12. Offers a 7 to 1 payout and loses on all other numbers.

winning_numbers: list[int] = [2, 3, 12]

Winning numbers for the bet

losing_numbers: list[int]

Losing number is anything except (2, 3, 12).

payout_ratio: int = 7

Payout ratio for the bet

class crapssim.bet.Horn(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

One-roll bet split across 2, 3, 11, and 12; loses on all other totals.

winning_numbers: list[int] = [2, 3, 11, 12]
losing_numbers: list[int]
get_winning_numbers(table: Table) list[int]

Returns the winnings numbers, based on table features and ruleset.

get_losing_numbers(table: Table) list[int]

Returns the losing numbers, based on table features and ruleset.

get_payout_ratio(table: Table) float

Payout ratios expressed as ‘to 1’, aligned with single bets and adjusting for the full bet amount returned on a win: - 2/12: (30 - 3) / 4 = 6.75 - 3/11: (15 - 3) / 4 = 3.0

__repr__() str
class crapssim.bet.World(amount: SupportsFloat)

Bases: _WinningLosingNumbersBet

One-roll bet covering Horn numbers plus 7; pays break-even on 7.

winning_numbers: list[int] = [2, 3, 7, 11, 12]
losing_numbers: list[int]
get_winning_numbers(table: Table) list[int]

Returns the winnings numbers, based on table features and ruleset.

get_losing_numbers(table: Table) list[int]

Returns the losing numbers, based on table features and ruleset.

get_payout_ratio(table: Table) float

Payout ratios expressed as ‘to 1’, consistent with simulator and adjusting for the full bet amount returned on a win:: - 2/12: (30 - 4) / 5 = 5.2 - 3/11: (15 - 4) / 5 = 2.2 - 7: (4 - 4) / 5 = 0.0

__repr__() str
class crapssim.bet.Big6(amount: SupportsFloat)

Bases: _SimpleBet

Even-money bet that wins on 6 before 7.

winning_numbers: list[int] = [6]

Winning numbers for the bet

losing_numbers: list[int] = [7]

Losing numbers for the bet

payout_ratio: float = 1.0

Payout ratio for the bet

number = 6
__repr__() str
class crapssim.bet.Big8(amount: SupportsFloat)

Bases: _SimpleBet

Even-money bet that wins on 8 before 7.

winning_numbers: list[int] = [8]

Winning numbers for the bet

losing_numbers: list[int] = [7]

Losing numbers for the bet

payout_ratio: float = 1.0

Payout ratio for the bet

number = 8
__repr__() str
class crapssim.bet.HardWay(number: int, amount: SupportsFloat)

Bases: Bet

Hard Way bet (on 4, 6, 8, or 10) in craps.

A bet on rolling a specific even number (4, 6, 8, or 10) with both dice showing the same value (e.g., two 2s for a hard 4). Wins if the number is rolled in a “hard” way before either a 7 or the number is rolled in a “soft” way.

payout_ratios

7 to 1 for hard 4 or 10, 9 to 1 for hard 6 or 8.

Type:

Payout ratios vary

number: int
payout_ratio: float
get_result(table: Table) BetResult

Core bet logic that determines the result.

This determines the ultimate amount and whether the bet needs to be removed, which is indicated with a BetResult object.

property winning_result: tuple[int, int]

Returns the dice result that wins, e.g. (2, 2) for Hard 4.

copy() Bet

Create a fresh copy of this bet

property _placed_key: Hashable
__repr__() str
__str__() str
class crapssim.bet.Hop(result: tuple[int, int], amount: SupportsFloat)

Bases: Bet

Hop bet in craps.

A one-roll bet on a specific dice combination. Can be an “easy” hop (different values on each die) or a “hard” hop (same value on both dice).

Payouts differ based on whether the hop is easy or hard, and are set in the table settings (TableSettings(), “hop_payouts”) - Easy hop: standard payout (default 15 to 1) - Hard hop: higher payout (default 30 to 1)

result: tuple[int, int]
get_result(table: Table) BetResult

Core bet logic that determines the result.

This determines the ultimate amount and whether the bet needs to be removed, which is indicated with a BetResult object.

property is_easy: bool

Whether this hop result uses two different dice faces.

property winning_results: list[tuple[int, int]]

All dice orderings that qualify this hop bet as a winner.

payout_ratio(table: Table) int

Return table-configured payout multiple for this hop type.

copy() Bet

Create a fresh copy of this bet

property _placed_key: Hashable
__repr__() str
__str__() str
class crapssim.bet.Fire(amount: float)

Bases: Bet

Fire bet in craps.

A progressive bet that tracks points made during a shooter’s turn. Wins with increasing payouts based on the number of unique point numbers made before a 7 is rolled.

Payout escalates as more points are made: - Specific payout ratios depend on table settings (TableSettings(), “fire_payouts”), default is 24 to 1 for four points, 249 to 1 for five points, and 999 to 1 for all six points. - Automatically ends when all 6 points are made or a 7 is rolled while the point is On.

points_made: set[int]
ended: bool = False
get_result(table: Table) BetResult

Core bet logic that determines the result.

This determines the ultimate amount and whether the bet needs to be removed, which is indicated with a BetResult object.

is_removable(table: Table) bool

Fire bet is removable only if there is a new shooter.

Returns:

True if the bet is removable, otherwise false.

Return type:

bool

is_allowed(player: Player) bool

Fire bet is allowed if there is a new shooter.

Returns:

True if the bet is allowed, otherwise false.

Return type:

bool

class crapssim.bet.All(amount: float)

Bases: _ATSBet

All bet (part of All/Tall/Small bets) in craps.

Wins when 2, 3, 4, 5, 6, 8, 9, 10, 11, and 12 all roll before a 7 rolls. Loses immediately if a 7 is rolled (including come-out sevens). Payout ratios are determined by the TableSettings() ([“ATS_payouts”][“all”]), which defaults to 150 to 1.

type: str = 'all'
numbers: list[int] = [2, 3, 4, 5, 6, 8, 9, 10, 11, 12]
class crapssim.bet.Tall(amount: float)

Bases: _ATSBet

Tall bet (part of All/Tall/Small bets) in craps.

Wins when 8, 9, 10, 11, and 12 all roll before a 7 rolls. Loses immediately if a 7 is rolled (including come-out sevens). Payout ratios are determined by the TableSettings() ([“ATS_payouts”][“tall”]), which defaults to 30 to 1.

type: str = 'tall'
numbers: list[int] = [8, 9, 10, 11, 12]
class crapssim.bet.Small(amount: float)

Bases: _ATSBet

Small bet (part of All/Tall/Small bets) in craps.

Wins when 2, 3, 4, 5, and 6 all roll before a 7 rolls. Loses immediately if a 7 is rolled (including come-out sevens). Payout ratios are determined by the TableSettings() ([“ATS_payouts”][“small”]), which defaults to 30.

type: str = 'small'
numbers: list[int] = [2, 3, 4, 5, 6]