Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(fn card [s]
(let [st (first s)
rk (last s)
suit (case st
\D :diamond
\H :heart
\C :club
\S :spade),
rank (case rk
\2 0
\3 1
\4 2
\5 3
\6 4
\7 5
\8 6
\9 7
\T 8
\J 9
\Q 10
\K 11
\A 12)]
{:suit
suit
:rank
rank}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.