Slowly the algorithm takes shape. Here I need to address the special case of the final merge : one of the 4 fusion algorithms must be chosen to ensure that the final block/run sits near the middle of the workspace, or at least not be cut in half by the wrap-around boundary.
To this end, I added the "auto" button so you just pound it until there is only one run left, not cut, ready to be written to a file in a single move. So far the heuristics work well :-)
That "auto" button is where the rest of the algo will take place, so the final algorithm will just be repeated calls to the corresponding function.
The code is there : YAMS_20220923.tgz.