straight line floodfill by I., S.

w=:3 :0
S
:
S=:x y}S
)
wd w#@$:^:*@({:@}:*'#'={:{'.'w}:)@([++^:(' '=+{w@])^:a:)"0~&(_1 1*/1,1+S i.LF)'.'i.~S=:1!:1]3

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page