1326 starting hold'em combos
Jelly, 21 bytes
9Ḋ;“TJQKA”Ṛp“cdhs”ŒcK
A full program printing the combos* separated by spaces (as a niladic link without the trailing K
the result would be a list of combos, where each combo is a list of lists, with integers for 2-9 and characters for other parts).
Try it online! (Note: change the trailing K
to L
and it will display the length of the list, 1326
.)
How?
9Ḋ;“TJQKA”Ṛp“cdhs”ŒcK - Main link: no arguments
9Ḋ - nine dequeued [2,3,4,5,6,7,8,9]
“TJQKA” - literal list of characters ['T','J','Q','K','A']
; - concatenate [2,3,4,5,6,7,8,9,'T','J','Q','K','A']
Ṛ - reverse ['A','K','Q','J','T',9,8,7,6,5,4,3,2]
“cdhs” - literal list of characters ['c','d','h','s']
p - Cartesian product [['A','c'],['A','d'], ... ,[2,'s']]
Œc - Unordered pairs [[['A','c'],['A','d']], ...(1326)...]
K - join with spaces (to pretty print, otherwise they all run
- together like AcAdAcAhAcAsAcKdAcKhAcKs...2d2h2d2s2h2s)
* it's what the kids call 'em!
Python 2, 100 98 bytes
r=range
d=lambda i:'AKQJT98765432'[i/4]+'cdhs'[i%4]
for u in r(52):
for t in r(u):print d(t)+d(u)
-2 bytes from dylnan
Try it online!
d
maps the numbers from 0 to 51 to card names such that they keep their sorting order (0-3 -> Aces, 4-7 -> Kings, etc)
The program loops over all pairs of numbers 0-51 where the second is greater than the first, and prints the pair of cards corresponding to that pair of numbers.