in reply to HangMan Question2..

Just declare $attempts at the beginning and set it to zero. Then increment it each time you read a guess. At the end, print it out.