Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Award money to winner at the end of each round #9

Closed
codegard1 opened this issue Jul 5, 2017 · 1 comment
Closed

Award money to winner at the end of each round #9

codegard1 opened this issue Jul 5, 2017 · 1 comment
Assignees

Comments

@codegard1
Copy link
Owner

codegard1 commented Jul 5, 2017

In _exitTrap(), evaluate whether any player is the winner of the round, and award that player the pot.

Once a winner is determined, run _evaluateGame() with the appropriate status code to end the game.

Determining a winner after each action:

  • If all players but one are busted, that player is the winner
    • if that player has BlackJack then evaluate status 5
  • if not all players are busted, compare handValue of each player
    • whichever player has the highest handValue is the winner
    • if the winning player is id 0 (human player) then evaluate status 3
  • if the human player (id 0) is busted and the Dealer (id 1) is not, evaluate status 4
  • if all non-busted players have the same handValue, the human player (id 0) wins
    • evaluate status 3
@codegard1 codegard1 self-assigned this Jul 5, 2017
@codegard1
Copy link
Owner Author

This is implemented in 9b22448 but needs more testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant