> The problem "feels" like a state machine problem, in that we can > imagine a machine in either one of two states: we're searching for the > start of a sequence of ones, or looking for the end of a sequence of > ones. We can represent being in a state via function call. The > following code is one way to do so:
Gah... typos in the comments. There should be a self-loop in the scanning-for-end, and "bound" should be "bounce". Sorry: I didn't unit test the comments. :) ____________________ Racket Users list: http://lists.racket-lang.org/users