;Program to Identify an Animal
;By: Rohit Kumar
;Dt: 12/10/02

(defun NotReptile ()
	(print "I am sure that the animal is a Mammal.")
	(let ()
		(print "Can the animal speak english (y/n)?")
		(if (string-equal (read) "y")
			(print "OK. So you were talking about some human.")
			(print "I can say that the animal is a mammal but not a human.")
		)
	)
)

(defun NotAmphibian ()
	(print "I guess the animal is either a reptile or a mammal.")
	(let ()
		(print "Ah yes. Tell me does the animal lay eggs (y/n)?")
		(if (string-equal (read) "y")
			(print "Finally. It is resolved. The Animal is a Reptile.")
			(NotReptile)
		)
	)
)

(defun NotBird ()
	(print "Hmm. I see that the animal definitely lives on land.")
	(let ()
		(print "By the way can it live in water also (y/n)?")
		(if (string-equal (read) "y")
			(print "OK. So you are talking about an Amphibian.")
			(NotAmphibian)
		)
	)
)

(defun NotFish ()
	(print "OK so the animal is definitely not a fish.")
	(let ()
		(print "So tell me. Can the animal fly (y/n)?")
		(if (string-equal (read) "y")
			(print "Good. So it is a Bird.")
			(NotBird)
		)
	)
)

(defun Animal ()
	(print "Please answer the following question in y or n.")
	(let ()
		(print "Does the animal live in water (y/n)?")
		(if (string-equal (read) "y")
			(print "It is a fish.")
			(NotFish)
		)
	)
)
