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.
Also I will add. If you want an additional challenge. Try to support x players rather than just the base 2.
This comment is hidden because it contains spoiler information about the solution
not neccesarily important, but it is a nice indicator that that value is the baseline for the rest of the operation.
Simple multi tiered problem. Blast to break down all the little bits to uncover a working solution. First go around with real TDD on this and while I didn't have a 1 line solution, I did wind up with something extremely readable :)
Any suggestions what test8 tests?
A few more details?
RNG probs
Sorry my mistake, it was not the sample test, it is test 2 of the "Attempt" tests. My code passes the sample test and all of the "Attempt" tests, except for "test2".
The difference between test2 and the sample test is that in the second array, at index 3, instead of it being 361 it's 36100.
And as I said before with the same function in CodeWars and in Eclipse, in codeWars I get "false" and "true" in Eclipse, the latter being the correct answer. ¯\(ツ)/¯
It should say "If a AND b are empty the result is evident by itself", meaning "true" because nothing is equal to nothing squared. The problem does not however make sense if one or both arguments are not lists/arrays (i.e. nil/None/null in languages where that can happen).
The tests are the same in all languages, 1518 guys (out of a total of almost 10,000) passed the Java kata - you could have seen that at the top of the page. There are no error in the tests. I am very sorry but your code is wrong.
Unfortunately "actual" and "expected" are swapped in Java tests but after that more than 500 guys passed the Java kata it was impossible to change anything so when you have "expected false, returned true", you should read it "expected true, returned false". Sorry for that inconvenience.
This comment is hidden because it contains spoiler information about the solution
@g964:
it's the same test like the Java Variant. It has the same mistake.
The kata was written long ago, expected and actual were swapped but, when it appeared, more than 500 guys had passed the Java kata so it was forbidden to change the tests (CW rule). Thanks for your post.
In java the test cases need to be looked at. I was failing on test8 and the result I was receiving was a little misleading. It stated that it expected false and got true, when in actuality it was the other way around. jUnit expects that the first value it the expected value.