From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a9916530bf157e77 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.130.195 with SMTP id u3mr22887690qas.1.1367665486162; Sat, 04 May 2013 04:04:46 -0700 (PDT) Path: y6ni7350qax.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news.stack.nl!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Depth First Search of a Char_Matrix? Date: Mon, 29 Apr 2013 16:40:52 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <87c89205-7fee-4d88-b4ab-08d26c03219b@googlegroups.com> <99d9a17c-ed8d-4c28-90d0-6543b511cb87@googlegroups.com> <4c3eca49-8ee6-4518-9968-879c08b828f6@googlegroups.com> <61f44636-ad71-447f-a20e-473e613f63ff@googlegroups.com> <5d751787-2574-475c-befc-553fcd02e6b6@googlegroups.com> Mime-Version: 1.0 Injection-Date: Mon, 29 Apr 2013 23:37:36 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="656ea2f23126f57fb36504d2d15a002c"; logging-data="2363"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18S9FaYB58IL2+2l68zWXaYS5MPfkW74Zo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <5d751787-2574-475c-befc-553fcd02e6b6@googlegroups.com> Cancel-Lock: sha1:UxsPUzzn66l8tknsWx2Enken8iE= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-04-29T16:40:52-07:00 List-Id: On 04/29/2013 01:55 PM, Alex wrote: > > begin > for R in 2..M'Length(1)-1 loop > for C in 2..M'Length(2)-1 loop > if M(R,C) = '.' then > DFS(R,C-1,'W'); If M (2, 2) = '.' then here you call DFS with X => 2 and Y => 1. > procedure DFS(X,Y:Integer; Char : Character) is > current : Character:= Char; > begin > Put_Line("X = " & X & " Y = " & Y); > if V(X,Y) = True or M(X,Y) = '/' or M(X,Y) /= current then And here you index V with (2, 1). -- Jeff Carter "Sir Robin the not-quite-so-brave-as-Sir-Lancelot, who had nearly fought the Dragon of Angnor, who nearly stood up to the vicious Chicken of Bristol, and who had personally wet himself at the Battle of Badon Hill." Monty Python & the Holy Grail 68