I'm creating a simplified program of Texas hold'em and I'm trying to create a function that builds a dictionary based upon the ranks of the cards.
For example, if I have:
H1: [6c, 2c, 6d, 6h, 2h, 6s, 3s]
H2: [6c, 2c, 6d, 6h, 2h, 3s, Ad]
I want to get something that looks like:
{2: [2c, 2h], 3: [3s], 6: [6c, 6d, 6h, 6s]}
when I call my function for H1
.
So I want to take the 7 cards and build a dictionary based upon the ranks. In this instance, I'm looking for four of a kind.