Draft

Pyramid of blocks

Description
Loading description...
  • Please sign in or sign up to leave a comment.
  • JohanWiltink Avatar

    Failed test cases should show their input.

  • JohanWiltink Avatar

    Random tests are testing the user solution against itself.

    • andreapt82 Avatar

      Adjusted, I understood, I think. User solution is the problem

    • JohanWiltink Avatar

      Now you have test.assert_equals(solve(x),calculate_height(x)), but assert_equals takes its arguments in order actual,expected. So the message will be wrong if the tests fails.

    • JohanWiltink Avatar

      Also, generating inputs from expected values is generally preferred over using a reference solution. In this case, it's possible ( see below ), it's faster, and it's also more readable ( and a lot shorter ) than your reference solution.

      Consider doing that.

    • andreapt82 Avatar

      thanks, I will try to adjust when I arrive home

    • andreapt82 Avatar

      About the order, please see the message returned:

      "20000 should equal 1"

      I forced the function in my solution testing the kata (I am changing the user solution, not the kata) to return 2000. In this case the message returned looks like ok, right?

      Message returned: "20000 should equal 1"

      2000 -> what user returned should equal 1 (1 is the right answer).

      Ok, right?

    • JohanWiltink Avatar

      No, not OK.

      Argument order is still wrong in random tests.

    • andreapt82 Avatar

      Same of the previous comment:

      User answered with 2000

      Right answer: 1

      System says: "2000 should equal 1"

      If I invert the order result in a wrong answer:

      1 should equal 2000. No, should equal 1.

      I think I did not understand the problem.

      You have 90K (kyu). I think you have the privilege to edit the kata. If you do this, please explain your change.

      Or please help me to understand better.

      Thanks

    • JohanWiltink Avatar

      Look at the argument order in the random tests.

      The fixed tests are fine, it's the random tests that still do it wrong.

    • andreapt82 Avatar

      Adjusted, thanks!

  • o2001 Avatar
    • Usage of Piramid in the title & description is a misspelling of Pyramid
    • "If you have a insuficient number of blocks in one line, you do not have to increment the height" is a bit misleading. I think changing it to something along the lines of "Return the number of lines that are completely filled with blocks. If the last line has missing blocks, it does not count." would be more readable.
  • saudiGuy Avatar

    random tests are not using a reference solution.

  • rowcased Avatar

    no random tests