The same thing as when offset < depth. The wave is infinite and periodic, it doesn't make any difference.
offset < depth
There is no instruction for what to do when offset >= depth.
offset >= depth
Test feedback could be much better if something like this is done:
console.log('expected:\n' + expected);
console.log('actual:\n' + actual);
Well, the point is it might. There are only 12 solutions around and they don't really say much.
How are 3 random tests not enough? What kind of solution would show the difference between 3 and 100 random tests and how many times would it have to be resubmitted to pass?
There are only 3 random tests per run (which is not enough, should be something like 100), and the test are making the old "duplicate test case generation code n times instead of putting it in a loop" mistake again.
The tests does not check if the thing thrown is actually according to the descriptions.
Not an issue ;-)
Please check and approve it! :-)
haha - you caught me, I created the solution on my phone on the way home and coudln't access a tab key at the time.
Speaking of indenting, nice solution Giacomo (*clicks neck back into place after staring so far to right of my screen *) :P
Try as a challenge to complete the Python track before our next katathon and let's see if proper indenting won't be ingrained into your subconscious by then :D
PHP translation added.
Dealing with the different possible conditions in the input makes this kata a great way to practice a variety of language features, and the tests for those conditions (and the resulting code) must be placed correctly! I like it.
Ruby and Python translations submitted if you wish to approve them!