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 has been added. Thanks for the feedback!
Thanks Steffen! I've approved this.
That is a much better approach to finding the missing length! Thanks for the guidance on Saturday, it was much appreciated!
This comment is hidden because it contains spoiler information about the solution
Not unless the car swerves off the road! I've adjusted the random generator so these events won't be generated. Thought it would be better than changing the tests (as that would cause the previous submissions to fail and the focus at this stage wasn't really on input validation).
Thanks Steve. I've now changed the random tests to not allow the car to move backwards. I'd deserve to be arrested if I was going backwards at 70kph!
I think you probably saw "return" in the messages I had in the tests. These are changed now!
I'm trying to give my users an option to return false or -1 in certain cases (mostly because in my first beta I asked for false when -1 makes most sense in the context). However, I'm having difficulty getting this to work in Test.assertEquals. I've been trying to enter the expected value as -1 || false , but this doesn't work (it only expects -1). Any ideas how I can do this?
The language of my kata is JavaScript if that makes any difference.
Thanks :)
Hi Pete, the test uses the tools codewars provide to test error. This expects you to throw Error rather than return 'error'. If you change the relevant parts of your script from "return 'error'" to "throw Error" you should get past the validation tests. There is quite good documentation online as to how to use this in your actual code. Hope this helps!
Yep - changed to be more consistent :)
Thanks for the feedback :) I have added a random test cases. Please let me know if you think more or different test cases are required.
This comment is hidden because it contains spoiler information about the solution