GOPHERSPACE.DE - P H O X Y
gophering on sdf.org
SDF's 25th anniversary
Saturday Jun 16  5:11:46 2012

;; sdf.lisp - In honor of 25 years of SDF, and my common lisp class

(defun ones (x)
  (if (< x 10) x
               (ones (- x 10))))

(defun num-suffix (x)
  (cond ((= x 1) "st")
        ((= x 2) "nd")
        ((= x 3) "rd")
        (t "th")))

(defun print-ann (year suffix)
  (format t "Happy ~S~a anniversary SDF!!!" year suffix))

(defun print-oper (year month day)
  (if (or (< day 16) (< month 6)) (format t "SDF has been in operation for ~
                                  (format t "SDF has been in operation for ~

(defun sdf ()
  (setf time (multiple-value-list (get-decoded-time)))
  (setf cur-year (sixth time))
  (setf month (fifth time))
  (setf day (fourth time))
  (setf anniversary (- cur-year 1987))
  (if (and (= month 6) (= day 16)) (print-ann anniversary (num-suffix (ones 
                                   (print-oper anniversary month day)))

(sdf)