next(
c
) =
{
wall if
N
(
c
) ≥
5
floor otherwise
N
(
c
) = walls among the 8 neighbours
initial wall %
50
threshold
5
Step
Run 4
Flood fill
New seed
Reset
iteration 0