a simple word guesser in javascript