Rather than counting mistakes, just allow mistakes, and just not let the puzzle get solved until it’s complete without mistakes.
This is how most of Simon Tatham’s puzzles work, and that works well.
This is how most of Simon Tatham’s puzzles work, and that works well.
They btw also have a feature that swaps main and secondary action when toggled, which could work here.
2. Even if brute force was a viable option for solving, an easy fix is to have a “submit” button when you think you’ve solved it (and that can track strikes for invalid submissions).