Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
by default will return None nice
Fixed.
A random tests on negative rounded values failed. Another try with same code has been successfull.
I saw that it was already previously araised, and recently annouced as solved.
Still an issue ?
bro that is super simple, you just basically need to loop n times, i hope that you asked in a genuinge way and not as a personal issue,
I did not coded it as intial solution since i had memory and big-o as priority.
Why not. Pls could you write a solution corresponding to your proposal
This comment is hidden because it contains spoiler information about the solution
Hi ,
just a remark about the desciption : as you clearly separate 2 cases : a==0 and a!=0, y'are not obliged to repeat if a==0 for the different subcases in the first case
I don't understand, sorry. What I did seemed the easiest way to be sure the requirement will be enforced. Keep in mind the extra events only have 1/10 chances to occur at each iteration.
By the way, it may not be necessary to specifically generate additional events, since now there are on average 0-2 cases with checking alphabetical order, then checking after each event can significantly increase this number on its own
Yes, in the JS version everything is not so bad, but in the Ruby version, instead of functions, I just put everything in one before, so there I will have to pick it apart
Python, although somewhat similar to Ruby, looks rather unusual, but I think I’ll figure it out. Thanks for the clarifications
Python updated. About the other languages being out of synch, it's not critical, no. Do it when you have time, then close the issue once it's done.
Cheers
Valid concern, yeah, but the order I chose also had a specific reason. Anyway, I think it's better to keep it in your way.
Yes, that's it. I enforced situations in the random tests were weapons with equal specs to the current best one will be generated. Tho, for now, they are generated at a random point in all the possible events whil the actual test is only done at the end ot all the events. Hence my suggestion abou adding more tests inbetween events.
The random tests update isn't that hard to implement, actually. I based the python tests on yours, even if I splited the functions a bit differently, the behavior is still the very same. So you can use them as "model". If you understand python, that is... I'll reupdate the python version, leaving comments for that part, so that you can spot what I do.
Hi
Added. I also changed the sequence of events in it so that test events with the same damage would occur both after and before, because without this there were incorrect decisions that would leave the weapon by default when the damage was equal. I also changed the name of the character so that the user would not think that this test is interconnected with the tests from the description.
I don’t quite understand what you mean, increase the number of weapons with the same damage in random tests in order to check more often in alphabetical order?
Yes, this is a good idea, I think you can check information about the character after each event, and the log only once at the end. True, I’m not sure that I can do this quickly enough, I wrote the side code for the tests rather dirty, and my knowledge of testing is superficial. But there’s probably nothing bad if it doesn’t appear in all languages at the same time, since it doesn’t change the kata itself in any way, but only improves the accuracy of the tests and the readability of the output.
Little bit of a slog, but I learnt some things. Thanks!
oops. Issue of mine... But that also means a fixed test about that is missing.
Loading more items...