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.
I've tried to help you out a bit with tests. I've fixed example test cases tab as it was missing assertEquals, and have done some tweaks to your tests. Have a look in your revisions panel on kata. Have a nice day :)
Thanks again. I implemented a custom string generator now. Still nonsenseical words, but it works :)
When enough people have solved your kata and there're no major issues unsolved, the kata can be approved by moderator and it'll be published.
PS: Your random test cases are now correct :) I would suggest using custom function in order to create random words with letters only, as some people will find it surprising that there're digits when you refer to strings as "words" in your kata description :)
Thanks again @gabbek.
I implemented it correctly now. Do you know how do I get my Kata out of Beta and published? Do people vote on it?
Thanks for the help!
I've changed the example to match the test.
I've also tentatively implemented a random test, but I'm unsure if I'm doing it right. I've pasted it below. I think asserting the function results equal the function results is bad form. Should I include a master function outside of what the user has provided in the test code?
var r1 = Test.randomToken();
var r2 = Test.randomToken();
var r3 = Test.randomToken();
Test.it("Random test", function() {
Test.assertEquals(ppap([r2, r1], [r3, r1]), ppap([r2, r1], [r3, r1]));
})
The example test lacks Test.assertEquals, there's only
ppap(["APPLE", "pen"], ["peN", "pInEapple"]) === "Pen-Pineapple-Apple-Pen"
It should be, for example:
Test.assertEquals(ppap(["APPLE", "pen"], ["peN", "pInEapple"]), "Pen-Pineapple-Apple-Pen");
Random tests are required so people can't hardcode solutions (check my solution for an example).
Best regards,
Gabbek
Hi, thanks for commenting! What fixes do you suggest for the example tests?
Random tests required, as well as some fixes to example tests.
your code runs fine.
It allows me to submit fine. Refresh the page, or wait a little while and try again.
This comment is hidden because it contains spoiler information about the solution