I have been trying to figure out how to solve the Square-1. I have some ideas and tried things that might possibly work / be needed for solving the puzzle, but I really need to be able to write algorithms for this puzzle. My problem is that the Square-1 doesn't have a solid shape / state which makes it difficult for me to figure out how to be able to write even basic algorithms. I don't want to look up the solution / solving guide. I would like to write my own algorithms and figure out how to solve the puzzle that way. Please help.

**Important: PLEASE NO SPOILERS OR ALGORITHMS ON HOW TO SOLVE THE SQUARE-1 OR SIMILAR PUZZLES. I'm just trying to figure out how to write algorithms for this kind of advanced puzzle**

Thanks!