1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
package game
import (
"fmt"
"strings"
"thehouseoficarus/internal/cardart"
"thehouseoficarus/internal/casino"
)
func renderPaiGowFelt(cfg casino.TableConfig, mode string, unicode bool) string {
c := newCrapsCanvas(25)
c.box(0, 0, 76, 24)
c.center(1, 75, 1, strings.ToUpper(cfg.PaiGow.Label()), crapsGold)
c.center(1, 75, 2, "LIMITS "+betLimitsText(cfg.MinBet, cfg.MaxBet), crapsInk)
note := "5% COMMISSION"
switch cfg.PaiGow.Normalize().Variant {
case casino.PaiGowEZ:
note = "NO COMMISSION | DEALER QUEEN-HIGH PUSHES"
case casino.PaiGowNoPush:
note = "NO COMMISSION | SPLIT: HIGHER EXTRA CARD WINS, TIES LOSE"
case casino.PaiGowFaceUp:
note = "NO COMMISSION | DEALER FACE UP | PUSH ACE HIGH " + strings.ReplaceAll(cfg.PaiGow.PushAceHigh, "_", "/") + ":1"
}
c.center(1, 75, 3, note, crapsInk)
c.box(0, 4, 76, 19)
c.text(3, 5, "FORTUNE - BEST OF ALL SEVEN CARDS", crapsGold)
c.text(50, 5, "ODDS", crapsGold)
envy := "ENVY OFF"
if cfg.PaiGow.Envy {
envy = "ENVY"
}
c.text(62, 5, envy, crapsGold)
for i, row := range casino.FortunePayTable(cfg.PaiGow.Envy) {
c.text(3, 6+i, row.Hand, crapsInk)
c.text(50, 6+i, fmt.Sprintf("%d:1", row.Odds), crapsInk)
if cfg.PaiGow.Envy {
c.text(65, 6+i, fmt.Sprintf("%d", row.Envy), crapsInk)
}
}
c.center(1, 75, 18, "Highest prize only. Winning Fortune wagers also return their stake.", crapsMuted)
note = "Envy disabled: quads improved from 25:1 to 30:1."
if cfg.PaiGow.Envy {
note = "Envy pays when other players hit quads or better."
}
c.center(1, 75, 20, note, crapsInk)
c.center(1, 75, 21, "High must outrank low. Copies lose.", crapsMuted)
c.center(1, 75, 22, "Joker: ace or completes straight/flush.", crapsMuted)
return c.render(mode, unicode)
}
func renderPaiGow(s *casino.PaiGowSnapshot, mode string, unicode bool, size int, style string, store *cardart.Store) string {
size = cardRenderSize(unicode, size)
lines := []string{renderPaiGowFelt(s.Config, mode, unicode)}
if len(s.Cards) > 0 {
lines = append(lines, "Your seven cards (positions 1-7):")
lines = append(lines, cardsLine(mode, s.Cards, size, unicode, style, store)...)
// Position labels use each card's actual rendered width; compact cards are
// variable-width, so print a separate unambiguous position-to-card key.
var positions []string
for i, c := range s.Cards {
positions = append(positions, fmt.Sprintf("%d=%s", i+1, cardSymbol(c)))
}
lines = append(lines, strings.Join(positions, " "))
}
for _, h := range []struct {
label string
cards []casino.CardView
}{{"Your high", s.High}, {"Your low", s.Low}, {"Dealer high", s.DealerHigh}, {"Dealer low", s.DealerLow}, {"Tiebreaker: player / dealer", s.Tiebreaker}} {
if len(h.cards) > 0 {
lines = append(lines, h.label+":")
lines = append(lines, cardsLine(mode, h.cards, size, unicode, style, store)...)
}
}
if s.Result != "" {
lines = append(lines, s.Result)
}
return strings.Join(lines, "\n")
}
|