shen/release/test_programs/whist.shen in shen-ruby-0.6.0 vs shen/release/test_programs/whist.shen in shen-ruby-0.7.0
- old
+ new
@@ -32,11 +32,11 @@
(define deck
{A --> (list card)}
_ -> (cartprod [2 3 4 5 6 7 8 9 10 11 12 13 14] [c d h s]))
(define cartprod
- {[A] --> [B] --> [(A * B)]}
+ {(list A) --> (list B) --> (list (A * B))}
[] _ -> []
[X | Y] Z -> (append (map (/. W (@p X W)) Z) (cartprod Y Z)))
(define deal-whist
{number --> (list card) --> ((list card) * (list card)) --> ((list card) * (list card))}
@@ -221,10 +221,10 @@
(define play-player
{(list card) --> card}
Cards -> (do (output "~%Your hand is ~%~%")
(show-cards 1 Cards)
- (let N (input+ : number)
+ (let N (input+ number)
(if (in-range? N Cards)
(nth N Cards)
(play-player Cards)))))
(define show-cards
\ No newline at end of file