Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
When tests fail, assertion message could be slightly improved. The part "Expected True but got False" is superfluous and potentially confusing, and information about tolerance is missing. MAybe you could check if using
test.expect
with a fully customised assertion message, including input values, expected values, actual values, and tolerance, would give a cleaner feedback on failure?No need to for now, but posting your code (properly formatted) would help. Do you know how to use code formatting with Markdown?
In what language?
What does it mean, "loops don't work"? Did you check the authoring examples collection?
You know that trolls starve when not fed? I do not know if the OP is a troll or not, but whenever you think you see one, just don't feed it. You reply, you lose.
As far "while" loops don't work, so i run the "while" loop in other code to print the tests.
There're no specific reason of number of tests (666).
C# tests contain methods which look like they should be test methods, but are not annotated and never called. The methods should be either removed, or annotated with
[Test]
.I am not sure which part you don't understand. Basically the requirement is to write a bunch of functions, which will return for exmple 35 when called like this:
seven(times(five()))
.If you call it locally in your IDE like this:
print(seven(times(five())))
it will print35
.Test code should be removed from preloaded: https://www.codewars.com/kata/reviews/5e935140955e440001e9ea1d/groups/6764af59f0e46282e42c620a
It does not look like this to me. Are you sure? Does it get fixed when you click RESET?
Your solution crashes for large numbers. Try running it with
n=160000
.The meaning of "consecutive" is explained in the description: "By not consecutive we mean not exactly 1 larger than the previous element of the array." So basically numbers which differ by more than one are not consecutive. In the example
[4,6,7,8,9,11]
the6
is not consecutive, because it does not come (as a natural number) after 4.Did you test your solution with examples? Did you try this test case?
test.assert_equals(first_non_consecutive([4,6,7,8,9,11]), 6)
Your solution has a bug and fails when the answer is on position
1
, for example[0, 2, 3]
. You need to fix it.Did you add all necessary imports to your code?
C# Random tests excessively print to stdout
Loading more items...