Skip to content

fix: avoid premature win on mismatch - #28

Merged
pekomon merged 1 commit into
mainfrom
codex/fix-bug-#5-and-add-unit-tests
Sep 9, 2025
Merged

pekomon merged 1 commit into
mainfrom
codex/fix-bug-#5-and-add-unit-tests

Conversation

@pekomon

@pekomon pekomon commented Sep 9, 2025

Copy link
Copy Markdown
Owner

Context & Root cause

  • Game considered won while last pair of cards was still face-up but unmatched.
  • checkForMatch called checkIfGameWon before mismatched cards were reset, allowing a false win detection.

What changed

  • Run win check only after match/mismatch resolution.
  • Add regression test for mismatched final pair.

Test plan

  • ./gradlew :app:assembleDebug (fails: SDK location not found)
  • ./gradlew test (fails: SDK location not found)

Risks & Rollback

  • Low. Revert commit bcb9239 if issues arise.

Fixes #5

Checklist

  • Tests added/updated
  • ./gradlew :app:assembleDebug
  • ./gradlew test

https://chatgpt.com/codex/tasks/task_b_68bf23bc3d3c832fb940a617a1b4e551

@pekomon
pekomon merged commit 7f2f1d2 into main Sep 9, 2025
2 checks passed
@pekomon
pekomon deleted the codex/fix-bug-#5-and-add-unit-tests branch November 1, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide stable keys in card grid

1 participant