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.
This comment is hidden because it contains spoiler information about the solution
"increasing" and "decreasing" should be specified better. ATM, testing is so limited it allows for solving with a third category "constant" - this may or may not even be intentional.
The author's solution as it exists does weird things on them, so for now, no.
Should the plateaus be considered?
If so, test cases should be reviewed
Needs random test cases, refer to this for examples :)
Needs random test cases
Similar to the "Overlapping Ranges" kata, please use the
Test.assertEquals
method. This at least makes it easy to see what the error was.Another suggestion is I highly recommend wrapping your tests in
describe
andit
blocks (in both Katas). This enables more than one test to run before bailing.BTW: bkaes has put together an amazing document about writing good Katas. Definitely worth a read!
Also, I believe the answer for this test is off-by-one. It states the index should be
3
, but at the index3
we're still increasing:It is a matter of opinion as to where the result should be, but it really seems like the first number that changes the pattern is at index
4
.Other issues:
3
, and the min overlap is1
. (The description states "…both ranges overlap by at least X numbers.")true
/false
you should useTest.assertEquals(actual, expected, msg)
, which will show what the expected result is. Since that still isn't very useful, it would be even better to change your message to actually say what should have happened ("The ranges 1…10 and 2…6 do not overlap by 12")You can wrap this in a helper function to make it easier, where you pass in the values and the expected outcome, and generate the test off of it.
X
, you should just call it something likerequiredOverlap
, and match the parameter name in the code setup.Your description of the problem doesn't match the expected solution or code setup (it says you'll receive an array, but 5 unique arguments are passed in).
There's also no example test cases, which doesn't help.