comp.lang.ada
 help / color / mirror / Atom feed
* Depth First Search of a Char_Matrix?
@ 2013-04-27 14:09 Alex
  2013-04-27 15:35 ` Shark8
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Alex @ 2013-04-27 14:09 UTC (permalink / raw)


Below is Char_Matrix representation of the board game "Go".  A 'W' represents a white piece, a 'B' represents a black piece, and a '.' represents a empty space.  Each black or white piece can either be alive or dead.  A piece is Alive is if it horizontally or vertically next to a '.' OR if it is horizontally or vertically next to another piece that is alive. You can think of aliveness as being contagious.  How can I use depth first search to count the number of alive black pieces and alive white pieces?  

WW.BB
.WWWW
WWBBB
BBBWW
WWBW.


In this example there are 11 alive white piece and 2 alive black pieces.

Can anyone provide any insight into this problem?

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-04-30 10:49 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-04-30 10:49               ` AdaMagica
2013-04-28 10:50 ` AdaMagica

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