We have a real challenge for you today - You are fighting against a monster and are strong enough to kill it with a few hits. But after every 3 pun...
For further actions, you may consider blocking this person and/or reporting abuse
I'm not sure I understand the assignment correctly. The damage I give to the monster is always 1, right? So if the monster's health is 3, it gets killed before it can attack back. It needs at least 4 hit points to be able to bite.
Solution in javascript:
Hello Hao, could u explain these 3 lines.ima beginner and trying to understand
const hits = Math.floor((m - 1) / 3);
const damage = hits * dm;
const health = h - damage;
Elixir:
Python:
I did it!
The following is my solution in javascript:
It returns
hits: 1, damage: 33, health: 67
for the first input, not the expected output. But my solution does the same...Update: It doesn't anymore.
JavaScript
Live demo on CodePen.
I didnot understand this brother. Could u clarify please.
damage * Math.floor((monsters-1) / 3) >= health