Not just looping, you could do a parallel graph search of the solution-space until you hit one that works.
Infinite Monkey Theory just reached its peak