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.
Removed test with
nullptr
root.same here
Duplicate issue.
C++ random test segfaults, but maybe you can submit your answer as C. Solution should be similar and C test doesn't segfaults.
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.
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.
Oops. My bad, haven't realized there is a third argument.
Thank you for your patience!
The C++ kata has been solved not once, but 209 times.
That is the code stub for the solution of the kata. Notice the firstAttacker (string) parameter.
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.
This comment is hidden because it contains spoiler information about the solution
Look at the C++ test cases BasicTest1 and BasicTest2 closely: they call the function with exactly the same arguments and expect different outcomes.
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.
C++ random tests SEG FAULT.
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.
This comment is hidden because it contains spoiler information about the solution