Skip to content

Flush lookup #45

@gregory-chatelier

Description

@gregory-chatelier
  1. Flush Detection: The code correctly identifies a flush by checking if all five cards share the same suit.
  2. Faulty Assumption: It then calculates a unique key based on the ranks of the cards in the flush and attempts to find this key in the flush_lookup table. The assumption was that any hand identified as a flush would
    have an entry in this special table.
  3. The Bug: The flush_lookup table is sparse and only contains entries for straight flushes. When the hand was a flush but not a straight flush (e.g., A, K, 5, 3, 2 of Spades), the calculated key would not be found in flush_lookup, resulting in a KeyError.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions