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

Ensure raises are called, fix edge cases with player options #85

Merged
merged 1 commit into from
Jun 13, 2021

Conversation

charleskawczynski
Copy link
Owner

This PR

  • Adds an assertion to ensure raises are called (via all_raises_were_called)
  • Fixes an edge cases where players are incorrectly given options when they shouldn't have any. For example, consider a heads-up game when the small blind player calls small blind (and is then all-in), the big blind has paid the blind, and has no action to make. In this case, the big blind was incorrectly given the option to check/raise/fold, which lead to downstream errors.
  • Adding !action_required(br_leader) to cond3 helped fix an edge case (maybe helped with the same one above?)

@charleskawczynski
Copy link
Owner Author

bors r+

bors bot added a commit that referenced this pull request Jun 12, 2021
85: Ensure raises are called, fix edge cases with player options r=charleskawczynski a=charleskawczynski

This PR
 - Adds an assertion to ensure raises are called (via `all_raises_were_called`)
 - Fixes an edge cases where players are incorrectly given options when they shouldn't have any. For example, consider a heads-up game when the small blind player calls small blind (and is then all-in), the big blind has paid the blind, and has no action to make. In this case, the big blind was incorrectly given the option to check/raise/fold, which lead to downstream errors.
 - Adding `!action_required(br_leader)` to `cond3` helped fix an edge case (maybe helped with the same one above?)

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jun 12, 2021

Build failed:

@charleskawczynski
Copy link
Owner Author

bors try

bors bot added a commit that referenced this pull request Jun 13, 2021
@bors
Copy link
Contributor

bors bot commented Jun 13, 2021

try

Build failed:

@charleskawczynski
Copy link
Owner Author

bors try

bors bot added a commit that referenced this pull request Jun 13, 2021
@codecov
Copy link

codecov bot commented Jun 13, 2021

Codecov Report

Merging #85 (0d2f4b1) into main (87ba8ba) will increase coverage by 0.21%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #85      +/-   ##
==========================================
+ Coverage   87.34%   87.56%   +0.21%     
==========================================
  Files           8        8              
  Lines         901      949      +48     
==========================================
+ Hits          787      831      +44     
- Misses        114      118       +4     
Impacted Files Coverage Δ
src/game.jl 97.42% <88.88%> (-1.97%) ⬇️
src/player_actions.jl 100.00% <100.00%> (ø)
src/table.jl 98.70% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87ba8ba...0d2f4b1. Read the comment docs.

@charleskawczynski
Copy link
Owner Author

bors r+

bors bot added a commit that referenced this pull request Jun 13, 2021
85: Ensure raises are called, fix edge cases with player options r=charleskawczynski a=charleskawczynski

This PR
 - Adds an assertion to ensure raises are called (via `all_raises_were_called`)
 - Fixes an edge cases where players are incorrectly given options when they shouldn't have any. For example, consider a heads-up game when the small blind player calls small blind (and is then all-in), the big blind has paid the blind, and has no action to make. In this case, the big blind was incorrectly given the option to check/raise/fold, which lead to downstream errors.
 - Adding `!action_required(br_leader)` to `cond3` helped fix an edge case (maybe helped with the same one above?)

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@charleskawczynski
Copy link
Owner Author

Hopefully this is the last time... closes #59

@bors
Copy link
Contributor

bors bot commented Jun 13, 2021

Build failed:

@charleskawczynski
Copy link
Owner Author

bors r+

@bors bors bot merged commit dd3c709 into main Jun 13, 2021
@bors bors bot deleted the ck/called_raises branch June 13, 2021 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant