Skip to content

Conversation

@Pashkiin
Copy link
Contributor

@Pashkiin Pashkiin commented Dec 7, 2025

Resolved issue #72

Changes made:

  • method "get_raise_amount" was renamed to "get_and_validate_raise_amount", to better decipher its new responsibilities
  • infinite while inside method was deleted. Now, the wrong inputs are controlled just by the "stubborn" parameter
  • method "get_and_validate_raise_amount" now apart from correctness of number itself and minimum raise also validates if the amount of chips is sufficient for that amount. Before it was checked each time after getting the raise amount. Now, it is centralised and enabled for some redundant code reduction
  • method "get_and_validate_raise_amount" is not throwing error messages by itself anymore. Now, in case of validation errors returns an error message. In main function after calling this function it is checked if error message was returned. If its not empty it means that validation was not successful and this message is being displayed on top
  • all parts of the code where the raise amount from user is fetched now uses updated logic
  • in print_game method an "if" statement was added to check if the "SHOWDOWN" part is not supposed to be currently displayed. My previous code ( see PR FIX / POKER - Clear screen on raise (Issue #61) #99 ) contained a bug, where opponent card were never displayed. This fixes it.

If you have any questions I will be happy to reply!
Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant