Skip to content

Fix three code bugs#1

Draft
RueHaile wants to merge 1 commit intomasterfrom
cursor/fix-three-code-bugs-50e9
Draft

Fix three code bugs#1
RueHaile wants to merge 1 commit intomasterfrom
cursor/fix-three-code-bugs-50e9

Conversation

@RueHaile
Copy link
Copy Markdown
Owner

@RueHaile RueHaile commented Oct 9, 2025

Fix game logic, stability, and portability issues by improving card handling, war resolution, and adding a missing include.

The war resolution logic was particularly problematic. Previously, if a player ran out of cards mid-war, the game would print an error and return, leaving game state inconsistent and potentially unresolvable. The fix now ensures that if one player can continue, they win the current pot and remaining cards, and if neither can continue, all piles are cleared for a clean game end. This prevents deadlocks and ensures proper game termination. The NO_CARD sentinel addresses a subtle logic error where 0 (a valid card) was used to indicate no cards, leading to incorrect comparisons and game outcomes during ties or war.


Open in Cursor Open in Web

Co-authored-by: hailer <hailer@berea.edu>
@cursor
Copy link
Copy Markdown

cursor bot commented Oct 9, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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.

2 participants