divide rectangles by tails

:0
N
/\w/!b0
s/11/&9/
:a
s/[2-9]/1&/g
y/23456789/12345678/
ta
:5
s/^/!/m2
s/1 / /
//b5
:
s/"\(!*\)\(| *|\n\)/\2\1"/
t
s/"//g
/!+/!s/!/"!/g
t
s//+/
:8
s/\(\(\S*\n\).*\)!/\1\2\2/
t8
s/^\S/&#/mg
s/1//
//b8
:4
s/"\(#*\)\([- ]\)/\2\1"/
t4
s/"//g
/#+/!s/#/"#/g
t4
s/#-/+ +-/g
s/# /| | /g
s/#\|\n //g

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

download

return to the top page