 For case #2, a path leading out of the area exists.Paint the pixel the painter is standing upon and move in the direction of the open path.For case #3, the two boundary pixels define a path which, if we painted the current pixel, may block us from ever getting back to the other side of the path.