Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2. data Values = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace deriving (Show)
  3.  
  4. data Suits = Spades | Hearts | Diamonds | Clubs
  5.  
  6. type Cards = (Values, Suits)
  7.  
  8. --greaterCard :: Cards -> Cards -> Bool
  9.  
  10. convertValue :: Values -> Int
  11. convertValue Two = 2
  12. convertValue Three = 3
  13. convertValue Four = 4
  14. convertValue Five = 5
  15. convertValue Six = 6
  16. convertValue Seven = 7
  17. convertValue Eight = 8
  18. convertValue Nine = 9
  19. convertValue Ten = 10
  20. convertValue Jack = 11
  21. convertValue Queen = 12
  22. convertValue King = 13
  23. convertValue Ace = 14
  24.  
  25. convertSuits :: Suits -> Int
  26. convertSuits Spades = 4
  27. convertSuits Hearts = 3
  28. convertSuits Diamonds = 2
  29. convertSuits Clubs = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement