Thank you, glad you had fun and met Steve! Loop detection was quite fun to implement, I did not think about counting turns and loops but that's an interesting solution that could've enable being less strict!
Basically, I've got templates for each loop, and I'm comparing how the shapes match for each of the templates according to two mathematical distances:
- a simple average of root-mean-square distances to determine which knot "fits best" among the templates
- Hausdorff distance to determine how well you've scored
Which, with some normalizing and rotations, works well enough IMO for a small jam game!