- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
;;; Returns a string and 'T' if the list is in a desc. or asc. order, and NIL otherwise
(defun ordered (list)
(let ((list-dec (copy-list list)))
(let ((list-inc (copy-list list)))
(let ((alist (sort list-inc #'<)))
(let ((dlist (sort list-dec #'>)))
(cond
((equal list dlist)
(format nil "~%The numbers in ~a are in a descending order. ~%T" list))
((equal list alist)
(format nil "~%The numbers in ~a are in an ascending order. ~%T" list))))))))