Repository navigation
Card Rat: ignore a late slap after a missed trigger - #230
Merged
Merged
Conversation
A slap that came just after a trigger card left the screen counted twice: once as a miss for the trigger, then again as a false alarm on the next card. Now, when the previous card was a missed trigger and the current card is not one to slap, the first slap is ignored. Later slaps on that card are still false alarms, and a slap on a card that is itself a trigger is still a hit. The false-alarm streak test only passed because it skipped a trigger before slapping, so the miss had already reset the streak. It now uses a deck whose triggers are spread out, so the false alarm alone resets it. Fixes #197 Signed: Claude Code (Claude Opus 5.5) for Aaron Crosman Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #197
Problem
A slap that came just after a trigger card left the screen counted twice. The trigger was scored as a miss when the next card was dealt, and then the slap counted as a false alarm on that next card. Both are wrong outcomes, so one late reaction also pushed the speed staircase two steps toward slowing down.
Change
game.jsnow setslateSlapPendingwhen a card is dealt right after a missed trigger. InrespondToCurrentCard():'ignored'. It changes no counts and no staircase state, and the UI shows no feedback and plays no sound. The miss sound already played when the card was dealt.initGame().index.jsand the tutorial need no changes.'ignored'already shows nothing, and in practice rounds the card to slap stays up until it is slapped, so a slap there can't be late. The issue's "sandwich (when enabled)" needs nothing extra, because sandwiches are always on today.Tests
game.test.jscases:misses === 0andconsecutiveWrong === 1.npm run lintis clean.npm run test:coveragepasses: 2117 tests, all thresholds met, 100% function coverage.Checked in the running app
I drove the app with Playwright, using an isolated
--user-data-dir. Each check waited for a trigger to pass, then pressed Space on the non-trigger card that followed:mainSigned: Claude Code (Claude Opus 5.5) for Aaron Crosman
🤖 Generated with Claude Code