MS-SQL, 137 bytes
SELECT v.value+s.value
FROM STRING_SPLIT('A-2-3-4-5-6-7-8-9-10-J-Q-K','-')v,STRING_SPLIT('H-S-D-C--','-')s
WHERE s.value>''OR v.value='J'
An array of values in SQL is returned as separate query rows. Uses the STRING_SPLIT function introduced in SQL 2016.
It includes the jokers by adding two "blank string" suits to take advantage of the existing "J" for Jack, then filtering out rows we don't want. Shorter than using UNION ALL statements to add the jokers.
BradC
- 6.9k
- 1
- 15
- 34