Thanks - that does help a bit. But it would take me too long (I'm lazy) to figure out all that code.
What would happen if this line
if (distance1 <0.15)
was changed to else if
And I suspect you could reduce that program to 25% of its present length if you modified your functions to take parameters so that (for example) a single
void lets_play_hangman(in hangValue) {
function that is called like
void loop() {
lets_play_hangman(play_hangman);
}
and similar changes for other repetitive bits.
IMHO it would also make the program easier to develop and debug.
...R