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.
Fixed tests should contain a word with 6 letters.
What constitutes a letter? -> elaborated more on that.
What constitutes a punctuation? -> again, elaborated more on that.
Description does not mention that stripping the essay and removing unnecessary spaces or their equivalents is required -> I made it so that doesnt happen (to my knowledge).
No example tests -> I added some (if you consider the tests I added as such).
Assertion messages exist for a reason, that is to not pollute the namespace with excessive printing, which is bad practices. -> I completely reworked the random tests, it no longer prints anything to the console.
Also in-accordance with statement right above and issue below, no one is going through that piece of essay for the sake of debugging, so with or without the assertion messages is deemed useless (No wonder Bob is struggling so hard though...) -> This one is on me xd, but I changed the random tests to be shorter and more readable, rather than the long block of text it was before.
Also also.. string manipulation is a duplicate and has been done to death -> Any suggestions? I usually do not mess with tags. I did not know that "string manipulation" was done to death, so I simply removed it.
Yeah, I thought that was going to be an issue like 20 minutes after publishing, but I couldn't really find a computer to change it, so here I am. I fixed it by creating more example tests, short random tests, and some long random tests.
came here to say just that
What constitutes a letter?
What constitutes a punctuation? (Based on tests, it seems to be limited to
.,?!;:
only.should be
periodspunctuationsDescription does not mention that stripping the essay and removing unnecessary spaces or their equivalents is required
No example tests
Assertion messages exist for a reason, that is to not pollute the namespace with excessive printing, which is bad practices.
Also in-accordance with statement right above and issue below, no one is going through that piece of essay for the sake of debugging, so with or without the assertion messages is deemed useless (No wonder Bob is struggling so hard though...
Also also.. string manipulation is a duplicate and has been done to death
You can't just throw a long essay composed of random words and expect user to just debug what's wrong with their solution easily when it doesn't match. Please, start the random tests with short input first.
Alright, I fixed the random tests. I think the issue was that I made the input for the function global, and I technically accessed it in my solution function. I made the inputs local.
It causes problems because your tests are written improperly, because your reference solution directly modifies
classes
, returns it, then uses it as the expected value in the test assertion, then passes the modified value into user function, all at the same time.This has nothing to do with Lua. This has to do with fundamental coding concepts of object ownership and mutability (and why you don't mutate inputs you receive without knowing what you're doing).
Try
This passes all the random tests.
Honestly, I am not the best at Lua, so I didn't know that modifying the table instead of creating a new one caused problems. Also, could you give an example of your issue, because a class's stats can sometimes remain the same (as in the example provided).
This is where your problem comes from. Why did you decide to ask to modify a table in place rather than returning a new table? This causes more problems than what it's worth.
Random tests are broken: the expected value is exactly the input
classes
instead of the actual answer.I completely changed the description to be more guiding, I hinted at Math.min() in it.
So when exceeding the length of any of the string arrays, we need to take the last string of that array.
I don't even see it in started code. I was performing
% format[i].length
.(edit) I see now that it is in the starter code, but that doesn't preclude stating it explicitly in the description.
Loading more items...