Ad
  • Custom User Avatar

    Removed test with nullptr root.

  • Default User Avatar
  • Custom User Avatar

    Duplicate issue.

  • Custom User Avatar

    C++ random test segfaults, but maybe you can submit your answer as C. Solution should be similar and C test doesn't segfaults.

  • Default User Avatar

    Random C++ tests are missing dashes/underscores.
    E.g.
    "a_Cat_is_pippiThe_pippi_is_kawaii" expects
    "aCatIsPippiThePippiIsKawaii" which is wrong because The in pippiThe should lose capitalization.
    "aCatIsPippithePippiIsKawaii" should be the correct expectation.

  • Default User Avatar

    Another example:

    "the_pippi_was-OmoshiroiA-pippi_was-Omoshiroi"
    ✘ Expected: equal to thePippiWasOmoshiroiAPippiWasOmoshiroi
    Actual: thePippiWasOmoshiroiaPippiWasOmoshiroi

    If you look closely, it expects the capital A in OmoshiroiA to be kept capital as if there was a dash/underscore before the A.

  • Default User Avatar

    Oops. My bad, haven't realized there is a third argument.
    Thank you for your patience!

  • Custom User Avatar

    The C++ kata has been solved not once, but 209 times.

    There is no firstAttacker in C++, and the calls to the function in both test cases above have the same arguments.

    std::string declareWinner(Fighter* fighter1, Fighter* fighter2, std::string firstAttacker)
    {
        // Your code goes here. Have fun!
    }
    

    That is the code stub for the solution of the kata. Notice the firstAttacker (string) parameter.

    std::string actual = declareWinner(&fighter1, &fighter2, "Harry");
    

    declareWinner is the function
    fighter1 and fighter2 are Fighter isntances
    "Harry" is the firstAttacker

    I'm not actually C++ programmer, but I cannot see a mistake in the code, only in your text and understanding of the kata.

  • Default User Avatar

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

  • Default User Avatar

    Look at the C++ test cases BasicTest1 and BasicTest2 closely: they call the function with exactly the same arguments and expect different outcomes.

  • Custom User Avatar

    No, they are not the same. In the description example, the firstAttacker is "Lew" while in BasicTest2 it is "Harry".

    Who attacks first, in this case, changes the outcome.

    Your work above where you manually solve the problem is wrong. You start with "Lew(10) attacks Harry(5) with 2; Harry has now 3" when Harry attacks first. This changes the outcome.

  • Default User Avatar

    C++ random tests SEG FAULT.

  • Default User Avatar

    To be more specific, C++ BasicTest2 contradicts the Instructions.
    Both describe the same test case, but in the Instructions Lew wins, whereas BasicTest2 expects Harry to win.
    There are no spoilers, btw.

  • Default User Avatar

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