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.
0! == 1!
, so it's not clear which we should return forn == 1
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/190.
Please join the discussion to help us identify duplicate kata and retire them.
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai).
Refer to this and this
This comment is hidden because it contains spoiler information about the solution
Python random tests:
'0!' should equal '1!'
According to the description, this input is invalid.
Forcing the user to type in the whole table (or searching for it as a textual data, and normalizing to be usable) is an absolutely terrible design choice. The thing must be preloaded.
Duplicate.
There are already plenty of factorial katas published.
Test.expect doesn't give information about the actual and expected values.
There is no test for negative values, the instrucions are confusing about this point, it tells the input will always be positive and then it says what to do if it's negative.
Returning different data types is not a good practice.
Javascript random tests only check up until "3!".
Edit: I looked into editing this myself, but JS is the original language and the author, aec58, is currently active. If the author sees this, consider making it a random chance to select a number from the table in my solution or to generate a random number. This should eliminate the issue.
It would be helpful to explain that null and single charater strings are to be considered IN ORDER. And that strings whic neither ascend nor descend eg. "oo" should also return IN ORDER.
I'm not quite sure about it, but seems that there should be "std::string" instead of "string" in the function proposal.
BTW. I've enjoyed your's task
Why is the user function being called with two parameters for the random tests? I was using that second parm!
It would be nice if the kata were explicit about whether being "in order" was case-sensitive, whether it applied to non-alpha characters, etc. I'm still not sure what the original intent of the kata is.
Much more tenuously, it might be nice to use a better type than a string as the return value in languages where that makes sense---in C++, something like
enum class ordering { in_order, in_reverse_order, not_in_order }
.I suggest adding to the description that even if two (or more) letters in a row are the same, rule is still met. For example: poll would be 'IN REVERSE ORDER'. I wonder what would be the right return value, if input would be 'aaa' for example. I suppose both in order and reverse should be correct.
Says input will always be a positive integer, then says what should happen with negative inputs.
Then does not test for megative inputs.
Suggest cleanup.
Loading more items...