Your string to integer conversions are wrong. In Python, the lookup dict is this:
Code:
{
'str_to_int':
{
'2c': 1, '2d': 2, '2h': 3, '2s': 4,
'3c': 5, '3d': 6, '3h': 7, '3s': 8,
'4c': 9, '4d': 10, '4h': 11, '4s': 12,
'5c': 13, '5d': 14, '5h': 15, '5s': 16,
'6c': 17, '6d': 18, '6h': 19, '6s': 20,
'7c': 21, '7d': 22, '7h': 23, '7s': 24,
'8c': 25, '8d': 26, '8h': 27, '8s': 28,
'9c': 29, '9d': 30, '9h': 31, '9s': 32,
'Tc': 33, 'Td': 34, 'Th': 35, 'Ts': 36,
'Jc': 37, 'Jd': 38, 'Jh': 39, 'Js': 40,
'Qc': 41, 'Qd': 42, 'Qh': 43, 'Qs': 44,
'Kc': 45, 'Kd': 46, 'Kh': 47, 'Ks': 48,
'Ac': 49, 'Ad': 50, 'Ah': 51, 'As': 52
},
'int_to_str':
{
1: '2c', 2: '2d', 3: '2h', 4: '2s',
5: '3c', 6: '3d', 7: '3h', 8: '3s',
9: '4c', 10: '4d', 11: '4h', 12: '4s',
13: '5c', 14: '5d', 15: '5h', 16: '5s',
17: '6c', 18: '6d', 19: '6h', 20: '6s',
21: '7c', 22: '7d', 23: '7h', 24: '7s',
25: '8c', 26: '8d', 27: '8h', 28: '8s',
29: '9c', 30: '9d', 31: '9h', 32: '9s',
33: 'Tc', 34: 'Td', 35: 'Th', 36: 'Ts',
37: 'Jc', 38: 'Jd', 39: 'Jh', 40: 'Js',
41: 'Qc', 42: 'Qd', 43: 'Qh', 44: 'Qs',
45: 'Kc', 46: 'Kd', 47: 'Kh', 48: 'Ks',
49: 'Ac', 50: 'Ad', 51: 'Ah', 52: 'As'
}
}
FYI:
'AhAs' = [51, 52]
'AdAcTh4c2c' = [50, 49, 35, 9, 1]
hand_rank = 32921 = [8, 153]