Ad
  • Custom User Avatar

    Also I will add. If you want an additional challenge. Try to support x players rather than just the base 2.

  • Custom User Avatar

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

  • Custom User Avatar

    not neccesarily important, but it is a nice indicator that that value is the baseline for the rest of the operation.

  • Custom User Avatar

    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 :)

  • Default User Avatar

    Any suggestions what test8 tests?

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    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. ¯\(ツ)

  • Custom User Avatar

    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).

  • Default User Avatar

    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.

  • Custom User Avatar

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

  • Default User Avatar

    @g964:
    it's the same test like the Java Variant. It has the same mistake.

  • Default User Avatar

    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.

  • Custom User Avatar

    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.