Created
May 16, 2015 04:12
-
-
Save Ajwah/0908ebf201d0508ef83d to your computer and use it in GitHub Desktop.
Convert (suit*rank) to string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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