games: the rake you pay, and the rake the table lifts
They are different numbers and the felt was quoting the wrong one. Every raked pot has chips lifted off it, whoever wins — that has to stay true or the table stops balancing. But the bots' chips are not real, so a pot a bot wins costs you nothing, and the counter under your stack was climbing anyway while you sat there folding. Rake is now every chip off the table (so the chips conserve) and Paid is the part that came out of a pot you won, which is the only part that is money and the only part worth telling you about. A chop costs you half of it. The audit log takes Paid too: the house's income is what it made off the player, not what it lifted off a bot. Claude-Session: https://claude.ai/code/session_013M5nD7PgUboJXoDcYHzpuJ
This commit is contained in:
@@ -356,6 +356,43 @@ func TestTheRakeSurvivesTheConstructor(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The house only makes money off you. A pot a bot wins is raked — that is what a
|
||||
// pot is — but the chips it comes out of are not real, so it has cost you nothing
|
||||
// and the number the felt quotes you must not move.
|
||||
func TestYouOnlyPayRakeOnPotsYouWin(t *testing.T) {
|
||||
s := State{Tier: Tiers[1], Flopped: true,
|
||||
Seats: []Seat{{Name: "You"}, {Name: "Dice", Bot: true}}}
|
||||
var evs []Event
|
||||
|
||||
// A bot takes it.
|
||||
s.payPot(Pot{Amount: 400, Eligible: []int{1}}, []ranked{{seat: 1}}, &evs)
|
||||
if s.Paid != 0 {
|
||||
t.Errorf("you paid %d in rake on a pot a bot won", s.Paid)
|
||||
}
|
||||
if s.Rake != 20 {
|
||||
t.Errorf("the table lifted %d off that pot, want 20 — the chips have to balance "+
|
||||
"whoever won it", s.Rake)
|
||||
}
|
||||
|
||||
// Now you take one.
|
||||
s.payPot(Pot{Amount: 400, Eligible: []int{You}}, []ranked{{seat: You}}, &evs)
|
||||
if s.Paid != 20 {
|
||||
t.Errorf("you paid %d in rake on a 400 pot you won, want 20", s.Paid)
|
||||
}
|
||||
if s.Rake != 40 {
|
||||
t.Errorf("the table has lifted %d in total, want 40", s.Rake)
|
||||
}
|
||||
|
||||
// And a chop costs you half of it.
|
||||
s.Paid, s.Rake = 0, 0
|
||||
s.payPot(Pot{Amount: 400, Eligible: []int{0, 1}},
|
||||
[]ranked{{seat: 0, rank: 9}, {seat: 1, rank: 9}}, &evs)
|
||||
if s.Paid != 10 {
|
||||
t.Errorf("you paid %d in rake on a chopped pot, want 10 — half the rake, "+
|
||||
"because you won half the pot", s.Paid)
|
||||
}
|
||||
}
|
||||
|
||||
func TestASplitPotSplits(t *testing.T) {
|
||||
s := State{Tier: Tiers[1], Seats: []Seat{{Name: "You"}, {Name: "A", Bot: true}}}
|
||||
var evs []Event
|
||||
|
||||
Reference in New Issue
Block a user