17 lines
497 B
Common Lisp
17 lines
497 B
Common Lisp
;;; CONDITIONALS 1: IF (solution)
|
|
|
|
(defun classify (temperature)
|
|
(if (> temperature 30)
|
|
"hot"
|
|
"pleasant"))
|
|
|
|
;;; ------------------------------------------------------------------
|
|
;;; Checks. Read them - they tell you what to aim for - but leave
|
|
;;; them unchanged.
|
|
;;; ------------------------------------------------------------------
|
|
|
|
(check-equal "hot" (classify 35))
|
|
(check-equal "pleasant" (classify 20))
|
|
(check-equal "hot" (classify 31))
|
|
(check-equal "pleasant" (classify 30))
|