Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-advanced-reader.ss" "lang")((modname |32.1|) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp")))))
4 (define-struct child (father mother name date eyes))
6 A ftn (family tree node) is either
7 1. empty or
8 2. (make-child f m na da ec) where f, m are ftns, na, ec are symbols, and da is a number.
10 all-blue-eyed-ancestors : ftn -> (listof symbol)
11 Given aftree0, return a list of all blue-eyed-ancestors as a (listof symbols).
13 (define (all-blue-eyed-ancestors aftree0)
14 (local ((define (all-a aftree1 accumulator)
15 ...))
16 (all-a aftree0 ...)))