Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    Fixed. Thank you

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    I'm leaving town, and I need my phone to have enough battery to last needFor minutes. I will be speaking/playing on it for activeUse 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.

  • Default User Avatar

    Thanks for your input, the test-case is fixed now :)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution