Skip to content

Instantly share code, notes, and snippets.

@Ajwah
Created May 16, 2015 04:12
Show Gist options
  • Save Ajwah/0908ebf201d0508ef83d to your computer and use it in GitHub Desktop.
Save Ajwah/0908ebf201d0508ef83d to your computer and use it in GitHub Desktop.
Convert (suit*rank) to string
fun c2s (s,r) =
let val r = Int.toString r
in case s of
Spade => " (Spade,"^r^")"
| Heart => " (Heart,"^r^")"
| Diamond => " (Diamond,"^r^")"
| Club => " (Club,"^r^")"
end
fun cl2s lst = List.foldl (fn(c,acc)=> acc^(c2s c)) "" lst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment