comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Depth First Search of a Char_Matrix?
Date: Mon, 29 Apr 2013 16:40:52 -0700
Date: 2013-04-29T16:40:52-07:00	[thread overview]
Message-ID: <kln07u$29r$2@dont-email.me> (raw)
In-Reply-To: <5d751787-2574-475c-befc-553fcd02e6b6@googlegroups.com>

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



  reply	other threads:[~2013-04-29 23:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 14:09 Depth First Search of a Char_Matrix? Alex
2013-04-27 15:35 ` Shark8
2013-04-27 17:25   ` Jeffrey Carter
2013-04-27 18:16     ` Shark8
2013-04-27 18:48       ` Dmitry A. Kazakov
2013-04-27 18:58         ` Shark8
2013-04-27 20:16           ` Dmitry A. Kazakov
2013-04-27 19:31       ` Simon Wright
2013-04-27 20:04         ` Shark8
2013-04-28  3:26       ` Jeffrey Carter
2013-04-27 16:27 ` Alex
2013-04-27 16:34   ` Shark8
2013-04-27 16:51     ` Alex
2013-04-27 16:55       ` Alex
2013-04-27 19:05       ` Shark8
2013-04-27 22:54         ` Alex
2013-04-27 22:56         ` Alex
2013-04-27 23:34           ` Shark8
2013-04-27 23:38             ` Alex
2013-04-29 20:55             ` Alex
2013-04-29 23:40               ` Jeffrey Carter [this message]
2013-04-30 10:49               ` AdaMagica
2013-04-28 10:50 ` AdaMagica
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox