;;; THE INTRO TO AI SHOW ;;; Summer Session I 1999 ;;; ;;; DEMO: ;;; "Ralph on net worth of Bringsjord brothers" ;;; ;;; by Selmer Bringsjord ;;; Set up the two competing Bringsjord brothers ;;; as special variables. (defvar *Conrad*) (defvar *Selmer*) ;;; Scripted questions for Ralph to pull in info for computing ;;; net worth of Bringsjord brothers. An error in processing ;;; occurs if Selmer is honest on the first pass about his age. ;;; How would you fix that? (defun ralph () "Ralph's insulting interrogation about net worth." (format t "~%Hello O Most Sorry Excuse for a Vulcan...") (format t "~%You are a professor. What profession is your brother?~%") (setf *Conrad* (list (read))) (format t "~%I see; impressive. And what is Conrad's age?~%") (setf *Conrad* (cons (read) *Conrad*)) (format t "~%Very well. And what about your own age?~%") (setf *Selmer* (list (read) 'professor)) (if (< (first *Selmer*) 35) (format t "~%Yeah, right. Try again:")) (setf *Selmer* (list (read) 'professor)) (format t "~%Hmm. Either you are still lying -- or you aren't aging well at all.") (format t "~%I heartily recommend a synthetic body.") (format t "~%At any rate, I offer you now a function to compute net worth.")) (defun net-worth (person) "Computes the net worth of a person based on that person's profession." (cond ((eql 'investment-banker (second person)) (* (first person) 100000)) ((eql 'professor (second person)) (* (first person) 10)) ((eql 'student (second person)) (* (first person) 100)) ( t '(The profession of the person you have entered is unknown to me))))