I moved the initialization of guess into the loop because of a bug. Consider the following:
You play a game, and on your last try you guess 10. Now guess=10.
The game restarts, and answer is set to a random number.
there is a 1% chance that answer will be set to 10, and then your `while guess != answer` will fail even though the user hasn't guessed yet!
The bug is that the previous game's guess can win the current game 1% of the time.

By moving guess into the loop, it is reset to 0 each time, which guarantees that it wont be equal to answer, which is always between 1 and 100.