Repository navigation
fix: cap keep/drop modifiers to the requested dice count - #8
Merged
Merged
Conversation
Keep-highest, keep-lowest, drop-highest and drop-lowest kept every copy of a value that straddled the keep/drop boundary: the running count of each kept value was never actually decremented, so a roll like 6,2,2,2 under 4d6kh3 kept all four dice instead of three. Rerolls were also silently skipped after being moved into a helper because the empty-check was inverted. Both paths are corrected and covered by direct unit tests plus seeded spec regressions. Fixes #7 💘 Generated with Crush Assisted-by: Crush:deepseek-v4.1-flash
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.
Summary
kh/kl/dh/dlnow keep exactly the requested number of dice. Previously any value appearing more than once was kept in full, so4d6kh3rolling 6,2,2,2 kept all four dice (total 12) instead of three (total 10).docs/roll.wasm.Fixes #7
💘 Generated with Crush