;; WRONG way, DOES NOT use data abstraction (define (count-total hand) (if (empty? hand) 0 (+ (first (first hand)) (count-total (bf hand))))) (define (is-flush? hand) (cond ((empty? (bf hand)) #t) ((equal? (bf (first hand)) (bf (first (bf hand)))) (is-flush? (bf hand)))) (else #f))) ;;;;;;;; ;; RIGHT way, with data abstraction (define (make-card value suit) (word value suit)) (define (get-value card) (first card)) (define (get-suit card) (bf card)) (define (count-total hand) (if (empty? hand) 0 (+ (GET-VALUE (first hand)) ;; changed here (count-total (bf hand))))) (define (is-flush? hand) (cond ((empty? (bf hand)) #t) ((equal? (GET-SUIT (first hand)) ;; changed (GET-SUIT (first (bf hand)))) ;; changed (is-flush? (bf hand)))) (else #f)))