I feel like this is a really simple solution to the problem, but it doesn't leave much space for logging (admittedly not necessarily a requirement for this kata) each iteration of the fight.
Instead of verifying in each iteration we can do that once after the control comes out of while loop which will decrease the execution time like I did.
@dinglemouse it is really nice solution to this Kata. I've come up with 70 lines of code comparing to yours 10
I feel like this is a really simple solution to the problem, but it doesn't leave much space for logging (admittedly not necessarily a requirement for this kata) each iteration of the fight.
simple, but keep it D.R.Y.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Instead of verifying in each iteration we can do that once after the control comes out of while loop which will decrease the execution time like I did.