You should probably add a description of what are the rules actually in the begining. Because just repeating the code without knowing them is frustrating untill you finished it.
Like: 1) If you miss you dead. 2) (Dragon have 5 hp) (you hit for 1-5 hp )if you hit for less than 4 he regenerates 3) and only if you hit for 5 - you win.
Also Math.floor itself wasn't explained thou you said you would. Not that it really hard to serch for it on the web but still.