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.
Whats good about this its easy to read, and if your password requirements were to change eg you need include a check for special characters, you can just add it to it without having to change the existing requirements or changing everything all at once.
This comment is hidden because it contains spoiler information about the solution
i still didn't understand, how i must to decode it.
Is there even some kind of algorithm that created the letter mappings? I've tried to figure it out at first (~15 mins), then i gave up and brute forced my way through it (press attempt to get the letters).
If there is a legitimate algorithm that maps the letters, the kata could easily be 2-4 Kyu. If there isn't, then most of the difficulty comes from getting all the letters, not the actual problem, which makes it 7 Kyu. That's a pretty big difference.
If there is an algorithm, could you post it somewhere (here, github, ...) so i can look at it, i'm just really curious how it works.
Thanks Voile, I split them out and added for loops for the random tests so that its not duplicating the random tests.
Please structure your tests properly:
describe
blocks can nest. Only the last block requires to be ait
block)Ahh gotcha that makes perfect sense! thank you this was my first authored Kata so I will keep that in mind
So it looks like this kata was retired, but for future reference, the issue with the implementation of the random tests was this:
This test ends up comparing the solution's answer to itself, which will return true regardless of the correctness of the solution. Instead, you'll want to have your own code within the submission tests which produces the correct answer and compare the solution's result to that. Something like:
where
referenceDecode
is a known correct solution.Thanks scarecrw! I added more random tests for both positive and negitive test cases, and validated that they are not returning false positives. Same with the other languages as well.
(In Java, didn't check other languages)
Thank you Voile, updated to have empty string return empty string, made the initial code be decode instead of decoded, and added notes about undefined and null in description.
Thank you Voile for this great feedback,I updated the example tests to be a subset of the main tests so they should all match. I also added both random positive and negative tests
Thanks Voile, I will get this fixed!
Sample tests and actual tests contain different test cases. Actual tests should at least be a superset of all sample tests.
There are no random tests.
Why empty string should return
unable to decode
? Empty string encodes to empty string, so it is a valid input.JS version: function name in initial code is
decoded
, but it should bedecode
.undefined
is passed into the function too. This is not mentioned.Loading more items...