From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: find path in a labyrinth Date: 24 Aug 2002 14:08:36 +0000 Organization: Naggum Software, Oslo, Norway Lines: 23 Message-ID: <3239186916978245@naggum.no> References: <3239181058184908@naggum.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: maud.ifi.uio.no 1030198117 9476 129.240.64.16 (24 Aug 2002 14:08:37 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 24 Aug 2002 14:08:37 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:38671 * "CheTeFreGa" | Yes is a restriction of my Software Engineering prof.! | can you help me, Erik? Please do not quote the entire previous article when you respond. Place your text below the short relevant extractions of the quoted article, like other people whose news articles you read do. Thank you. Naïve labyrinth traversal is very simple. At every juncture, try every direction (except the one you came from) in order as long as each attempt fails, but if you have only one choice, just keep going, return failure if none of your directions yield success. Success is defined as finding an exit. This is a nice, clean, recursive function with no assignment. An alternative approach, which is not naturally recursive, is to keep left and remember where you were so you backtrack when you walk back along the same path you came. An interesting problem is how you deal with circular paths in both approaches. I assume you know whether you have them or not. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.