Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Flood-fill

Author: Robert Hyatt

Date: 21:12:37 12/03/02

Go up one level in this thread


On December 03, 2002 at 23:29:56, Dann Corbit wrote:

>On December 03, 2002 at 20:48:18, Arshad F. Syed wrote:
>
>>Sorry if this has been discussed before, but please could someone explain
>>briefly what flood-fill in bitboards is about. Don't need any code snippets.
>
>Floodfill idea is like this:
>1111111111111111111111
>1000000000000000000001
>1000000000000000000001
>1000000000000000000001
>1000000000011111111111
>1000000000010000000001
>1000000000010000000001
>1111111111111111111111
>
>See the box in the lower right hand corner?  If I seed the interior and run a
>floodfill algorithm, I can find that the box is closed because the algorithm
>will terminate with this image:
>1111111111111111111111
>1000000000000000000001
>1000000000000000000001
>1000000000000000000001
>1000000000011111111111
>1000000000011111111111
>1000000000011111111111
>1111111111111111111111
>
>General discussion:
>http://www.cs.unc.edu/~mcmillan/comp136/Lecture8/areaFills.html


ANd it can be used to answer questions like:

with pawns on these squares, and these squares under attack by the opposing
king, do I have any possible penetration path into the enemy pawn structure or
am I blocked out totally?

Is my piece trapped?

Is this hole in my opponent's pawn structure reachable by a knight of mine?

Lots of similar questions that are really search questions, but the flood-fill
algorithm really is a sort of parallel search from point x to point y, to see
if the two squares can be connected, by moving a king around to every possible
path, except that it doesn't take the time of traversing every path serially
as they are done in steps and not very many of those...




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.