func OrderedLoop[A, B any](in <-chan A, done chan<- B, n int, f func(a A))
Instead of: func OrderedLoop[A, B any](in <-chan A, done chan<- B, n int, f func(a A, canWrite <-chan struct{}))
Or is there a reason that "f" can't be wrapped in an anonymous function to handle the blocking logic?
We ended up with some rules like "all puzzle pieces must be adjacent to another puzzle piece", "no puzzle piece may overlap another puzzle piece", and "all puzzle pieces must overlap the silhouette" (the puzzle goal), and "no piece may partially overlap the silhouette".
I didn't really know how to detect "overlap" reliably so I ended up implementing some heuristic methods. I remember tearing my hair out over the way JavaScript numbers worked and figuring out how to reliably compare floating point numbers. Good times.
The github repo for the library is still around. Last commit... 9 years ago, woof, time flies! And of course one of the last commits is "Fix overlap bug". Figures.
[1] https://en.wikipedia.org/wiki/Tangram [2] https://github.com/gabesullice/libshapes