This lesson has been corrupted. You're supposed to be building the code from scratch, but the final code is in all of the examples. In every lesson after this one, you can just hit "run" and it work. But that's not the way the code was intended. The intent is to get you to recreate the code from scratch.
So the first segment should have been about setting your variables, the second was to create the while loop, etc. - in the while loop, you HAVE to set the slaying to false or else it would be an infinite loop. That's how the game ends - with a false value.
So that's why the code is correct, but the computer doesn't accept it - all of the code is there, and the end result of slaying ends up being "false" to exit the loop.
But the code that's supposed to be there at this stage, if the lesson wasn't corrupt, is just the basic setting up of the variables, in which case slaying would be true (which would set up the while loop).
The code in the "helpful response" puts the variable of true at the bottom to override the false value in the while loop for the sake of the computer giving you the ok, but it's best to declare your variables at the top.
If you want the learning experience, DELETE the code in the second example and write all of the code from scratch. The first section is just about setting up the variables, so do that, and the code clears.