Exercise 5.1.2: (back)

;; check-guess: number number -> { 'TooSmall 'Perfect 'TooLarge }
(define (check-guess guess target)
  (cond
    [(< guess target) 'TooSmall]
    [(= guess target) 'Perfect]
    [(> guess target) 'TooLarge]))

    
;; Tests
> (check-guess 2 3)
'TooSmall

> (symbol=? (check-guess 2 3) 'TooSmall)
true


> (check-guess 3 3)
'Perfect

> (symbol=? (check-guess 3 3) 'Perfect)
true


> (check-guess 3 2)
'TooLarge

> (symbol=? (check-guess 3 2) 'TooLarge)
true