How to check if a zone is closed or open ?

alt text
Hello,
I have these blocks the player will put on a grid and I need to know when the layout of the blocks forms a closed area. For now I have absolutely no clue :smiley: Any idea, method, direction to look at ?

flood fill

like for a bucket tool in a paint software ?

Thanks again. The flood fill was the perfect solution.
That is what I got after few hours

@dba999 are you building a level out in 3D or 2D?