SICP Exercise 3.33 constraint propagation averager
Exercise 3.33. Using primitive multiplier, adder, and constant constraints, define a procedure averager that takes three connectors a, b, and c as inputs and establishes the constraint that the value of c is the average of the values of a and b.
SOLUTION
The code is here.
The picture below shows how the constraints and connectors are assembled:
SOLUTION
The code is here.
The picture below shows how the constraints and connectors are assembled:
Comments
Post a Comment