Skip to content

Commit

Permalink
Behavior change: a deal action is no longer needed to transition betw…
Browse files Browse the repository at this point in the history
…een states EXCEPT to begin a round of poker
  • Loading branch information
alexclewontin committed Oct 2, 2020
1 parent ce1bc23 commit 3a355bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
50 changes: 0 additions & 50 deletions actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Flop
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 25)

Expand All @@ -317,11 +312,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Turn
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

Expand All @@ -342,13 +332,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

//River

err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

if err != nil {
Expand Down Expand Up @@ -440,11 +423,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Flop
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 25)

Expand All @@ -465,12 +443,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Turn
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

if err != nil {
Expand All @@ -485,12 +457,6 @@ func TestIntegration_Scenarios(t *testing.T) {

//River

err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

if err != nil {
Expand Down Expand Up @@ -576,11 +542,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Flop
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 25)

Expand All @@ -607,11 +568,6 @@ func TestIntegration_Scenarios(t *testing.T) {
}

// Turn
err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

Expand All @@ -627,12 +583,6 @@ func TestIntegration_Scenarios(t *testing.T) {

//River

err = Deal(g, pn_a, 0)

if err != nil {
t.Errorf("Test failed - error dealing: %s", err)
}

err = Bet(g, pn_b, 0)

if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion game.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func (g *Game) updateRoundInfo() {

for _, num := range g.pots[i].WinningPlayerNums {
g.players[num].Stack += (g.pots[i].Amt / uint(len(g.pots[i].WinningPlayerNums)))
//TODO: leave the remainder in the middle! (some money will disappear currently)
//TODO: leave the remainder in the middle! (fractional money will disappear currently)
}
}

Expand All @@ -394,6 +394,7 @@ func (g *Game) updateRoundInfo() {
// otherwise, just set betting to false so the dealer can deal the next part of the hand
} else {
g.setBetting(false)
deal(g, g.dealerNum, 0)
}
return

Expand Down

0 comments on commit 3a355bb

Please sign in to comment.