Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- datatype suit = Clubs of string
- | Diamonds of string
- | Hearts of string
- | Spades of string;
- datatype rank = Jack of string
- | Queen of string
- | King of string
- | Ace of string
- | Num of int;
- type card = suit * rank;
- fun card_color c =
- case c of
- Clubs _=> "Black"
- | Diamonds _=> "Red"
- | Hearts _=> "Red"
- | Spades _=> "Black";
- fun card_value c =
- case c of
- Jack _=> 10
- | Queen _=> 10
- | King _=> 10
- | Ace _=> 10
- | Num n=> n;
- fun remove_card (cl: card list, c : card) =
- case cl of
- []=>[]
- | xs::ys => if c = xs then remove_card(c,ys)
- else xs::remove_card(c,ys);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement