Re: Finding blocks of symbols on a 2dimensional array
- From: Jordan Abel <random832@xxxxxxxxx>
- Date: 9 Jan 2006 16:55:20 GMT
On 2006-01-09, efialtis <efialtis@xxxxxxxxxxx> wrote:
> Hi to all,
>
> I am creating a program which plays a game. The game is played
> on a NxN square board. In every position of the board we may have
> a ball or not. Take for example the following 5x5 board ( x : ball,
> o : empty space).
>
> x x o o x
> x o o o o
> o o x x o
> o o o x x
> x x o o o
>
> I want to write a function which calculates the number of ball blocks
> on a specific board. For example the above board has 4 ball blocks
> (1 or more balls being surrounded by empty spaces).
>
> The problem is that i cannot think of any elegant algorithm to
> calculate this number.
>
> Any idea welcome...
> Thank you for your time.
some kind of flood fill algorithm, maybe? [this doesn't really belong in
this newsgroup]
.
- References:
- Finding blocks of symbols on a 2dimensional array
- From: efialtis
- Finding blocks of symbols on a 2dimensional array
- Prev by Date: Re: segfault w/ block, but not file scope
- Next by Date: Re: Google foulups
- Previous by thread: Re: Finding blocks of symbols on a 2dimensional array
- Next by thread: Re: Finding blocks of symbols on a 2dimensional array
- Index(es):
Relevant Pages
|