Ad
  • Custom User Avatar
  • Custom User Avatar

    TEAM C won two matches (1x0 and 3x2). Receives 6 points and a total of 4 scored goals.

    Should be:

    TEAM C won two matches (2x1 and 3x2). Receives 6 points and a total of 5 scored goals.

    Given these two matches results:

    "TEAM A 1 x 2 TEAM C", "TEAM B 2 x 3 TEAM C"

    What's wrong there are the first match result and the total scored goals.

  • Custom User Avatar

    Hello, looks like a misprint in kata description:
    ["TEAM C", "6", "5"]
    instead of
    ["TEAM C", "6", "4"], or
    TEAM C won two matches (1x0 and 3x2). Receives 6 points and a total of 4 scored goals.
    instead of
    TEAM C won two matches (1x0 and 3x2). Receives 6 points and a total of 5 scored goals.

  • Custom User Avatar

    it would be definitely best and short solution with these last 3 lines:

    return good > evil ? 'Battle Result: Good triumphs over Evil' :
    evil > good ? 'Battle Result: Evil eradicates all trace of Good' :
    'Battle Result: No victor on this battle field';

    btw great job!

  • Custom User Avatar
  • Custom User Avatar

    The function should return true if a triangle can be built with the sides of given length and false in any other case.

    That's the point, if some side value is 0 (because of what I quoted before) or is negative it isn't a triangle and those tests expect false. Not a kata issue.

  • Custom User Avatar

    Yes, some tests do not follow these rules. To pass the kata I had to change my solution, because tests form triangles with 0-sides and negative sides (what?)

    Javascript language.

  • Custom User Avatar

    Both of those are in this line:

    (In this case, all triangles must have surface greater than 0 to be accepted).

    Do you mean there are some tests that expect another thing? In which language?

  • Custom User Avatar

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

  • Custom User Avatar

    Well, I got this one:
    STDERR
    Traceback (most recent call last):
    File "tests.py", line 16, in
    test.assert_equals(helper.page_index(0), 0, 'page_index returned incorrect value')
    TypeError: 'int' object is not callable

    In my IDE all works fine.