Figured it out, thanks for all the help Matthias. --- On Tue, 11/30/10, Matthias Felleisen <matth...@ccs.neu.edu> wrote:
From: Matthias Felleisen <matth...@ccs.neu.edu> Subject: Re: [racket] Missionaries and cannibals To: "Ken Hegeland" <hege...@yahoo.com> Cc: us...@lists.racket-lang.org Date: Tuesday, November 30, 2010, 11:12 PM On Nov 30, 2010, at 4:09 PM, Ken Hegeland wrote: > In the book it said that generally an accumulator should be added after > completing the function, is it not possible without one, or is it just very > difficult? It says that for STRUCTURALLY RECURSIVE FUNCTIONS you can usually get away w/o an accumulator. But it is easier to formulate certain problems with accumulators. Solving a puzzle where you can easily generate an infinite sequence of 'boat trips' that correspond to an infinite loop in computing implies that you are looking at a GENERATIVE RECURSIVE FUNCTION. Next: one step with the introduction of accumulators is to exploit the knowledge that is accumulated. This may mean checking for cycles in a graph or cycles in boat trips. Try that -- Matthias
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users