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.
Empty string is a special case which doesn't really make sense in a reader.
But anyhow, that would means nothing, thus :
i do agree this is in conflict with the "Returns at least one char" instruction
(i don't remember if this was in the description i specified 9 years ago or if someone added that line since then)
but defensive programming is always recommended and those values are easily testable
as soon as there is one char, you get a line and a word
but there is a special weird case, what if the text as chars, but it only contains spaces ?
...
there is no word!
Or just randomize tests order as a first step?
Yeah sure, good luck figuring that out without solving the kata first.
Feel free to brutforce and cheat the kata. It's not about that, it's about finding a performant logic.
For this very kata, generating random tests would prove challenging. Possible though, but it would generate meaningless sentences and add a great complexity in the tests logic.
Feel free to submit a PR.
Please clarify why this is an issue ?
Sure, feel free to submit a pull request to improve the tests.
This kata was made almost 10 years ago, out of generosity on my free time, and is free.
You can't expect it to be bulletproof or with a gold level support.
And, if you try to think as the test developper, you'll see it is challenging to simulate memory limitation with the provided tools.
Btw, Which solutions violate the rule ?
The whole point of this kata is that it is possible to respect the rule and code efficiently. If choose not you, it's your problem, not really mine.
Approved, thanks!
I'm sorry .reset() got you confused. You choose to focus on the wrong things. The template is quite straightforward:
ok thanks
hmm right, i forgot about that. It's difficult to check for literal regexp... Sorry for the time lost.
you should be able to use comments. RegExp are disabled like this:
RegExp = undefined;
Hello,
Sorry I didn't catch your message at the time.
I think it was a temporary codewars error. It is working right now (just tried to submit your code).
Hello, I'm the kata author.
Are you still having this issue?
I've just tried to click Attempt with a valid solution and it works.
In case it still doesn't work, please provide your solution (here or on any pastebin).
You're correct regarding the string "t four dead.Zombie ipsum" for the memory test.
But not correct on the numbers. The standalone text is:
The standalone text is repeated 5109x2x10= 102180 times.
(5109 times to fill memory with ~6Mo and a trick to duplicate this by 2 so that getChunk returns a ~12Mo string each call which forces you not to allocate more memory ; and repeated 10 times indeed).
102180*176 = 17983680 should be the correct word count
I've added an extra space between each block so the new characters count expected is: 124250880
I agree it not cool to have a "dead.Zombie" in a test case so I've just updated the test.
However, this is the last test case, you should already have a robust code with previous tests.
Adding random is a bit more complicated. I don't have time for this.
The goal of the test is to have fun and learn things.
If you look at people solutions, most don't use a hack.
This is not an official exam. If people don't play by the rules, it is their problem.
But they take a risk because I can update tests anytime.
Thank you for your feedback.
Didn't get a notification, thanks for pinging me again.
Ok let me take a look at your message about test case 44.
>.<
I should add some random test cases to avoid hard coded stuff like that
Loading more items...