one tiny bug: rand(0...10) that's inclusive, so that's 11 outcomes where in python it's 10. I don't actually care and will approve that, would be nice if it's the same though. same with 0...5 of course
I think you're seeing errors from different tests. The UI unfortunately doesn't make this very clear. One thing you can try to do is use something like console.log(a, b, margin) in your function to see what exactly is being tested.
This same kata was mentioned earlier in a different comment.
I'll repeat what I mentioned there:
Although I may be biased, I would still argue that this kata is considerably different given the rules and data structure. E.g. there's an arbitrarily large range of floors to handle, basements are allowed, the elevator stops in less places, etc. I would imagine solutions would need to be quite different.
Okay, first of all, I apologize. The Python "small building" tests were supposed to span under 15 different floors. I fixed that now so hopefully the issue you're having is easier to see.
Anyway, I added only 1 of your examples to the Python tests, plus another one that I think illustrates the problem you're having. I.e. this one:
Good suggestion! I added a bunch more "small building" tests. Some languages run the tests in random order, and I may have to change the labeling in some cases to fix it unfortunately.
Sorry, I couldn't think of better names at the time. 😅
It's not inclusive.
I added the other cases.
You're right, and thanks for the feedback. I made them distinct and followed the logic of Python snippet you provided. Check it out!
I think you're seeing errors from different tests. The UI unfortunately doesn't make this very clear. One thing you can try to do is use something like
console.log(a, b, margin)
in your function to see what exactly is being tested.If
margin
is not provided (undefined
), then it should be no different than passing in0
formargin
.Essentially, you need to make sure that
closeCompare(a, b) === closeCompare(a, b, 0)
.Thanks, approved!
Thanks, approved!
Thanks, approved!
This same kata was mentioned earlier in a different comment.
I'll repeat what I mentioned there:
Sounds good, added!
Okay, first of all, I apologize. The Python "small building" tests were supposed to span under 15 different floors. I fixed that now so hopefully the issue you're having is easier to see.
Anyway, I added only 1 of your examples to the Python tests, plus another one that I think illustrates the problem you're having. I.e. this one:
Feel free to let me know if that's enough!
I added more test cases. I even had to optimize some of my solutions further. I think it's in a good place now.
Good suggestion! I added a bunch more "small building" tests. Some languages run the tests in random order, and I may have to change the labeling in some cases to fix it unfortunately.
Okay, I updated the rules to be clearer (hopefully)!
This comment is hidden because it contains spoiler information about the solution
Loading more items...