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.
Thank you very much for your advice and for correcting my sloppy English)
I agree that it is wrong to allow non-numeric characters and removed it from the tests. I also changed the name of the function a bit, but still left the input and output parameters as strings. I think it will help improve the skills of working with strings.
Fixed. Thank you
Oops, fixed that, and also added the double threat test to the default test fixture.
Also needed to update the comments on the code that was given to the user, which were at odds with the description and tests.
I've updated the kata for multiple threats, you should now return an array (even for threats of one). The order of pieces returned in multiple threat scenarios should not be a problem.
Also added a situation where the only way to avoid a mate is to perform an en passant.
Also had to backtick the coffeescript solution once again, since I don't have time right now to handle it properly.Edit: now available in pure CS again.
Oh, right, I tried to think of a situation where there would be more than one threat but couldn't think of one, I'll add it now.
As for en passant, I thought about it but didn't implement it. I think I'll add it as additional properties for the piece that moved previously, which would make it possible to check for it as well.
I didn't have a single timeout with my code during the edit phase. Of course it might be possible that they allocate more processing time when you run it in the kata editor, but I doubt it, as it would be possible to make katas that timed out with the correct solution.
I'm leaving town, and I need my phone to have enough battery to last
needFor
minutes. I will be speaking/playing on it foractiveUse
minutes. Of course, battery is still consumed (as idle time), whether I'm speaking/playing or not, but idle time consumes much less battery than activeUse.If activeUse is greater than needFor, then the solution should definitely return false.
Thanks for your input, the test-case is fixed now :)
This comment is hidden because it contains spoiler information about the solution