Ad
  • Custom User Avatar

    There seems to be an issue either in the description or in the 3rd test. The description says that strength represents the weight that breaks the web and the task asks us to calculate how many elephants can be placed without breaking the web, so total weight of elephants should be smaller than the strength of the web.

    However, test case 3 expects a web with strength 532000 and width 532 to be able to hold 532 elephants. This means that 532 elephants on the first row, weighing 1000kg each, for a total of 532000kg would not break the web with strength 532000. Since 532000kg is explicitly stated as the weight that breaks the web, the expected answer seems to be wrong.

    It would be better to either make it clear in the description that the web will still hold the weight exactly equal to its strength or change the expected output of the third test to 531 elephants.

  • Custom User Avatar

    Badly written Java tests

    In tests, asserts are written the wrong way round, making failing test messages very confusing.
    The first value you should put into your assertEquals() is the correct value you are expecting and the second one sould be the result of the actual expression. That way if the test fails, you get a message saying "Expected "CorrectValue", got "WrongValue"". In this kata the values are switched around so when the test fails, the message says "Expected "WrongValue", got "CorrectValue"" which is very confusing.
    I sugget rearranging the assertEquals arguments to make this katas' failing test messages more useful and less confusing.

  • Custom User Avatar

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

  • Custom User Avatar

    Too easy for kyu 5, should be 6 or even 7