about summary refs log blame commit diff stats
path: root/README
blob: 04e10a89dd7481e2ba4372c274c794a91b15d67b (plain) (tree)
f">bf deck))))) ) (define (make-ordered-deck) (define (make-suit s) (map (lambda (rank) (word rank s)) '(A 2 3 4 5 6 7 8 9 10 J Q K)) ) (se (make-suit 'H) (make-suit 'S) (make-suit 'D) (make-suit 'C)) ) (define (make-deck) (define (shuffle deck size) (define (move-card in out which) (if (= which 0) (se (first in) (shuffle (se (bf in) out) (-1+ size))) (move-card (bf in) (se (first in) out) (-1+ which)) )) (if (= size 0) deck (move-card deck '() (random size)) )) (shuffle (make-ordered-deck) 52) )