package casino import ( "fmt" "strings" ) // BaccaratRulesText travels with the configured table, never with scenery. func (c TableConfig) BaccaratRulesText() string { c = c.Normalize() b := c.Baccarat variant := "Commission punto banco" // Avoid floating-point display noise in the commission percentage. banker := fmt.Sprintf("Banker wins pay %s (commission %s%% of winnings)", payoutRatio(b.BankerPayout), strings.TrimRight(strings.TrimRight(fmt.Sprintf("%.6f", (1-b.BankerPayout)*100), "0"), ".")) switch b.Variant { case BaccaratSuper6: variant = "Super 6 / no commission" banker = "Banker wins pay 1:1, except a winning 6 pays 1:2 (two or three cards); no commission" case BaccaratEZ: variant = "EZ Baccarat / no commission" banker = "Banker wins pay 1:1, except a winning three-card 7 pushes; no commission (Player bets still lose)" } optional := func(enabled bool, text string) string { if enabled { return "Enabled; " + text } return "Not offered" } return strings.Join([]string{ "Baccarat table " + c.ID + " — rules", "Variant: " + variant, fmt.Sprintf("Number of decks: %d", b.Decks), "Player wins pay 1:1", banker, "Tie pays " + payoutRatio(b.TiePayout) + "; Player and Banker bets push on ties", "Player pair (player_pair): " + optional(b.PairBets, "11:1; first two Player cards have identical rank"), "Banker pair (banker_pair): " + optional(b.PairBets, "11:1; first two Banker cards have identical rank"), "Dragon 7 (dragon_7): " + optional(b.Dragon7, "40:1; Banker wins with a three-card 7"), "Panda 8 (panda_8): " + optional(b.Panda8, "25:1; Player wins with a three-card 8"), "Super 6 bet (super_6): " + optional(b.Super6Bet, "12:1; Banker wins with 6 (two or three cards)"), "Optional bets settle independently; pairs can win on ties; Dragon/Panda/Super 6 require an outright hand win", "Scoring: Ace = 1; 2–9 face value; 10/J/Q/K = 0; highest last digit of the sum wins", "Drawing: Automatic punto banco; no player hit/stand decisions", "Naturals: An initial 8 or 9 on either hand stops all drawing", "Player draws on 0–5, stands on 6–7 (unless a natural ends play)", "Banker, if Player stands: Draw on 0–5, stand on 6–7", "Banker, if Player draws: 0–2 draw; 3 draws except against 8; 4 against 2–7; 5 against 4–7; 6 against 6–7; 7 stands", "Fractional credits: Rounded down; any commission rounds up and is collected on each win", "Wagers: One main bet (player, banker or tie) plus any enabled side bets; side bets are placed before the main wager", "Available bets: " + b.betChoices(), "Bet limits (all wagers): " + betRangeText(c.MinBet, c.MaxBet) + " credits", fmt.Sprintf("Seats: %d; betting window: %d ticks", c.MaxPlayers, c.BettingTicks), fmt.Sprintf("Shuffle threshold: %g%% of shoe remaining; reshuffle before a round if fewer than six cards remain", b.ShuffleAt*100), "Dealing style: Automatic; no player squeeze, shoe passing, or burn-card ceremony", }, "\n") }