Thanks for playing and ideas. And yeah, sadly the bugs in the loops evaded me.
Viewing post in Loopy Lines jam comments
Yeah I imagine that's not trivial. There's the winding number (warning: math) but that is defined for closed loops, so a slightly different situation