Draft
Pyramid of blocks
Loading description...
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Failed test cases should show their input.
Actual answer: "2 should equal 3".
User response is 2. The software was expecting 3. Is not clear?
input, not output.
so "calculate_height(7): 2 should equal 3".
thanks, I will try to adjust when I arrive home
Adjusted. Seems ok in the tests, but I did the same changes in the example tests and the changes was not exhibited in the example tests :(
It's in the Example tests as well, but to see that you may have to refresh if you opened the trainer earlier.
Random tests are testing the user solution against itself.
Adjusted, I understood, I think. User solution is the problem
Now you have
test.assert_equals(solve(x),calculate_height(x))
, butassert_equals
takes its arguments in orderactual,expected
. So the message will be wrong if the tests fails.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.
thanks, I will try to adjust when I arrive home
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?
No, not OK.
Argument order is still wrong in random tests.
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
Look at the argument order in the random tests.
The fixed tests are fine, it's the random tests that still do it wrong.
Adjusted, thanks!
Piramid
in the title & description is a misspelling ofPyramid
"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.Adjusted. Ok?
Yup :)
random tests are not using a reference solution.
this does not really pinpoint the actual problem. generating inputs from random expected values does not use a reference solution either, but is actually a best practice.
This comment has been hidden.
He is using the user's solution as the reference solution.I didn't notice that you had already raised it as an issue now. Maybe I didn't write it properly.
Yes, the problem as you had written it was unclear to me, until I looked at the tests.
Off-topic, but let me know your opinion about this.
We have been receiving a lot of complaints.
this link is locked to me
no random tests
Yes, we have random tests. Please verify again.