Repository navigation
fix(copi): evaluate special_lead_cards per round in highest_scoring_cards_in_game - #3792
Open
shikhabhadoria wants to merge 1 commit into
Open
shikhabhadoria wants to merge 1 commit into
shikhabhadoria wants to merge 1 commit into
Conversation
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.
Description
In
copi.owasp.org/lib/copi/cornucopia.ex,highest_scoring_cards_in_game/1previously calledspecial_lead_cards/1on the flat list of all scoring cards across the entire game before grouping byplayed_in_round. Becausespecial_lead_cards/1checks jokers, trump suits, andList.first(ordered_played_cards).card.categoryacross its input list, a different lead suit, trump card, or joker in one round filtered out scoring cards from other rounds.This PR groups scoring cards by
played_in_roundfirst and appliesspecial_lead_cards/1followed byhighest_card/1independently to each round's cards, and adds multi-round regression tests incopi.owasp.org/test/copi/cornucopia_logic_test.exs.Fixes #3783
AI Tool Disclosure
[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.][e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.][Summarize the key prompts or instructions given to the AI tools]Affirmation