Hello I was wondering if someone could help me with a family tree function in scheme. What I have right now is:
;;proper-blue-eyed-ancestor?: ftn -> boolean
;;consumes:an ftn
;;produces:a list of all the eye colors of the people you can get to
;;from that node
(define (proper-blue-eyed-ancestor? a-ftn)
(cond
[(empty? a-ftn) false]
[(ftn? a-ftn) (or(proper-blue-eyed-ancestor?
(ftn-father a-ftn))
(proper-blue-eyed-ancestor? (ftn-mother a-ftn))
(symbol=? 'blue (ftn-eyes a-ftn)))]))
now my problem is the "or" after
(ftn? a-ftn)
causes it to look at the persons u start off with and counts him/her too. For example if the persons name you type in has blue eyes, but his ancestors don't it comes back true, but its supposed to come back false because I only want it to look at the ancestors of that person...any help? oh and putting a "and" in there doesn't work either.