Skip to content

Instantly share code, notes, and snippets.

@bhenry
Created October 26, 2011 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhenry/e4c60f16c99ea9b30bb7 to your computer and use it in GitHub Desktop.
Save bhenry/e4c60f16c99ea9b30bb7 to your computer and use it in GitHub Desktop.
(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