Finding blocks of symbols on a 2dimensional array
- From: efialtis <efialtis@xxxxxxxxxxx>
- Date: Mon, 09 Jan 2006 18:42:00 +0200
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.
.
- Follow-Ups:
- Re: Finding blocks of symbols on a 2dimensional array
- From: Alex Fraser
- Re: Finding blocks of symbols on a 2dimensional array
- From: Jordan Abel
- Re: Finding blocks of symbols on a 2dimensional array
- From: Nelu
- Re: Finding blocks of symbols on a 2dimensional array
- From: pemo
- Re: Finding blocks of symbols on a 2dimensional array
- Prev by Date: Re: Structure
- Next by Date: Re: Finding blocks of symbols on a 2dimensional array
- Previous by thread: Re: x86 Stack Confusion
- Next by thread: Re: Finding blocks of symbols on a 2dimensional array
- Index(es):
Relevant Pages
|