You are given a small card-table game where a legal move is to choose three visible cards whose values sum to 15.
Across the interview, you will fix move validation, implement a basic chooser, measure strategy quality by simulation, and improve the strategy.
You are given a card game simulation. The game maintains a set of cards currently visible on the table, and players may select three cards from the table to score points.
A valid move must satisfy both of the following:
- All three selected cards are currently on the table.
- The three selected cards sum to 15.
The existing implementation has a bug: in some cases, it allows the strategy to select cards that are not actually present on the table.
Your task is to identify and fix the bug so that every selected move uses only cards currently available on the table.
test_rejects_card_not_on_table
test_rejects_using_same_single_card_twice
test_accepts_real_triple_from_table