20. Tightrope

Some people had trouble understanding this description. In a computer-like language:

a = distance from square to circle 1
b = distance from square to circle 2
green if a and b are within 20 of each other

Write:

  1. Model
  2. The function square-color: model -> color.