SHARE
TWEET

Untitled

a guest Jan 21st, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top