Update hangman.java

I have changed the "do while" loop to a "for" loop