Card Table
Project 3 was a four-player card game. Over ten turns each player discards ten cards, then arranges those discards into groups to score: sets of a kind, alternating-colour runs, and anything left over counts against you.
My 2019 submission was lost. The scorer and the solver are rebuilt from the game rules, then checked against reference Python on 500 random groups, 200 groupings and 18 full best-partition searches.
- comp10001go_score_group()
- comp10001go_valid_groups()
- comp10001go_best_partitions()
Hand #10001
Your table
Tap cards to select them, then make a group. On a computer you can also drag cards between groups. Every card left in the hand scores on its own.
- No groups yet. Select two or more cards and press “Make a group”, or drop cards here.
Your score
-74
A legal grouping.
Bonus question · comp10001go_best_partitions
Best grouping
The bonus question asked for every highest-scoring way to group up to ten cards, under a strict time limit. This solver checks all 115,975 ways to split 10 cards, in a Web Worker so the page stays responsive.
Questions 1 and 2
In Python
Select some cards to score them as a group.
>>> comp10001go_valid_groups(groups) # 10 groups True
Evaluation, new in 2026
Can an LLM find the best partition?
The same seeded hands for the exact solver, a greedy baseline and a language model on your own key: how often each is legal and optimal, and how far it falls short, with 95% intervals.
Question 1 · comp10001go_score_group
How a group scores
Numbers below are computed live by the same scoring function the table uses.
On its own
-20A single card scores minus its value. Jacks, queens and kings are 11, 12 and 13; an Ace costs 20.
N-of-a-kind
+78Two or more cards of the same value (not Aces) score the value times N factorial.
13 × 3! = 78
Run
+30Three or more consecutive values in alternating colours, with at least two non-Aces. It scores the sum of its values.
9 + 10 + 11 = 30
Run with a wild Ace
+18An Ace can fill a gap inside a run if its colour fits the pattern. Here the red Ace stands in for a 6.
5 + 6 + 7 = 18 (1 wild Ace)
Not a group
-9Two blacks in a row break the run. An invalid group scores minus the total of its cards.