;;;; PRELIMINARY -- ian oct.19 (fri) ;; A rank is a number in [MIN-RANK,MAX-RANK]. (define MIN-RANK 2) (define MAX-RANK 14) ; 11 = jack; ... 13=king, 14=ace. ;; nums-upthrough: int int --> list-of-num ;; Return a list of integers [start,stop] ;; (Note that "stop" *is* in the returned list.) ;; (define (nums-upthrough start stop) (cond [ ] [else ])) (define suitranks ...) (define deck ...) ;; shuffle: list-of-ANY --> list-of-ANY ;; Return a list with the original's contents, but ;; in a scrambled order. ;; (define (shuffle stuff) ;; beats?: rank, rank --> boolean ;; (defined (beats? rank-a rank-b) (cond ;; battle: list-of-two-hands --> list-of-two-hands ;; Flip top card of each hand, ;; and put them on top of the winner's deck. ;; (define (battle players) (local [(define a (first players)) (define b (second players)) (define a-top (define b-top (define ;; war: list-of-two-hands --> {'a, 'b} ;; Battle until somebody loses. ;; Return 'a if first player wins, or 'b if second player wins. ;; NOTE: May not terminate??? ;; (define (war players) (local [(define a (first players)) (define b (second players))] (cond