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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.75.137 with SMTP id y9mr11736295qaj.3.1367080043779; Sat, 27 Apr 2013 09:27:23 -0700 (PDT) X-Received: by 10.49.129.233 with SMTP id nz9mr1176007qeb.10.1367080043758; Sat, 27 Apr 2013 09:27:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!news.glorb.com!s14no143009qam.0!news-out.google.com!ef9ni27001qab.0!nntp.google.com!s14no143002qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 27 Apr 2013 09:27:23 -0700 (PDT) In-Reply-To: <87c89205-7fee-4d88-b4ab-08d26c03219b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=134.240.94.19; posting-account=CZZpzgoAAAAoaHoNNp9zhY9EzQgEmxhU NNTP-Posting-Host: 134.240.94.19 References: <87c89205-7fee-4d88-b4ab-08d26c03219b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Depth First Search of a Char_Matrix? From: Alex Injection-Date: Sat, 27 Apr 2013 16:27:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:15176 Date: 2013-04-27T09:27:23-07:00 List-Id: On Saturday, April 27, 2013 10:09:10 AM UTC-4, Alex wrote: > Below is Char_Matrix representation of the board game "Go". A 'W' repres= ents 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 pie= ce is Alive is if it horizontally or vertically next to a '.' OR if it is h= orizontally or vertically next to another piece that is alive. You can thin= k of aliveness as being contagious. How can I use depth first search to co= unt the number of alive black pieces and alive white pieces? =20 >=20 >=20 >=20 > WW.BB >=20 > .WWWW >=20 > WWBBB >=20 > BBBWW >=20 > WWBW. >=20 >=20 >=20 >=20 >=20 > In this example there are 11 alive white piece and 2 alive black pieces. >=20 >=20 >=20 > Can anyone provide any insight into this problem? Shark you are correct, I forgot to include the fact that only like colors = are contagious. Thank you very much for your assistance. Without providin= g the code how would I change it to reflect this piece of missing logic?