Lisp Calendar Function by Shane Zentz
; Shane Zentz
; C-311
; Homework 6
(defun next-day (day)
"This function returns the next symbol in a list"
(cond ((equal day 'monday) 'tuesday)
((equal day 'tuesday) 'wednsday)
((equal day 'wednsday) 'thursday)
((equal day 'thursday) 'friday)
((equal day 'friday) 'saturday)
((equal day 'saturday) 'sunday)
((equal day 'sunday) 'monday)))
next-day
(setq days "monday")
"monday"
(next-day 'monday)
tuesday
(setq ddd "tuesday")
"tuesday"
(next-day 'tuesday)
wednsday
(setq eee "sunday")
"sunday"
(next-day 'sunday)
monday
(defvar DAYS '(sunday monday tuesday wednesday thursday friday saturday))
DAYS
(defun random-day (L)
(setq x (abs (mod 7 (random))))
(print "Topdy is " (capitalize (symbol-name (elt L) x))
(print "and tomorrow will be "
(capitalize (symbol-name (cdr(L)))))))
random-day
(random-day DAYS)
(defun calander (i days)
"calander that starts at index i (day of the week) and prints cal for days"
)