Guest User

Untitled

a guest
Jul 17th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. > (load "solution1.scm")
  2. #<unspecified>
  3. > (define 5hearts (a-card 5 'hearts))
  4. #<unspecified>
  5. > (define KingOfSpades (a-card 13 'spades))
  6. #<unspecified>
  7. > (a-card 0 'spades)
  8.  
  9. Attention: Not a valid card (0 spades)
  10. > (a-card 25 'diamonds)
  11.  
  12. Attention: Not a valid card (25 diamonds)
  13. > (a-card 3 'apples)
  14.  
  15. Attention: Not a valid card (3 apples)
  16. > (a-card 'K 'hearts)
  17.  
  18. Attention: Not a valid card (k hearts)
  19. > (= (rank 5hearts) 5)
  20. #t
  21. > (eq? (suit KingOfSpades) 'spades)
  22. #t
  23. > (card? KingOfSpades)
  24. #t
  25. > (card? 10)
  26. #f
  27. > (load "sample-hands.scm")
  28. #<unspecified>
  29. > (bridge-score f1)
  30.  
  31. Attention: A hand has to have 13 cards
  32. > (bridge-score f2)
  33.  
  34. Attention: A hand has to have 13 cards
  35. > (bridge-score f3)
  36.  
  37. Attention: Repeated card in the hand
  38. > (bridge-score hand1)
  39. 19
  40. > (bridge-score hand2)
  41. 0
  42. > (bridge-score hand3)
  43. 23
  44. > (bridge-score hand4)
  45. 18
  46. > (bridge-score hand5)
  47. 3
Add Comment
Please, Sign In to add comment