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.
Lol, seriously? This isn't enough for you?
That's about as explicit a definition as you can have without giving away the recursion solution. Also, five years later and I still need to explain this is a simple recursion exercise, not an innovative mathematical exploration. What is up with the people on this site.. it's bizarre. The last comment on the discourse below by @xcthulhu is like the most insane "I'm smarter than you" pissing contest comment I've ever read.
Updated to include
Eq
in the deriving clause, thanks.Sorry about that. Reviewed and merged, thanks!
This comment is hidden because it contains spoiler information about the solution
Sorry, I should have reviewed this more thoroughly. I'm aiming for a fairly easy kyu level here. Would you mind editing your translation so that users are only tested against a finite list of integers?
Thanks!
Lgtm!
Sorry about that! Haven't been on in a while. Approved.
Yeah this was due to hidden tab characters, fixed now.
Fixed... for some reason they don't have vim on the kata creation text boxes, throws me off.. wish they would just default to spaces when you hit TAB.
Damn, this still isn't fixed. It's been 4 months, please just give a simple update with those 2 lines above! They work for the examples, but obviously end users cannot add them to the real tests.
I like this kata but the description needs improvement. I also failed on last test because of this requirement: "And don't forget about nested functions. You shouldn't handle them." This needs more explanation..
When I say function, I am referring to the mathematical definition of a function. It is a mapping of elements to elements. This is a 6kyu dude, and I wrote it as a 7kyu. It is a simple recursion exercise; I am not requiring people to have efficient solutions.
What's up with you guys... I already explain that the factorial function we know and love is defined only for nonnegative integers. And you are incorrect - this function, as I define it, is defined for all integers. Obviously your JS solution will not be able to evaluate it for all integers due to physical memory and time restrictions, but mathematically it's defined for all integers.
You and xcthulhu are really missing the point here. This is the "non-discriminate factorial", and you don't even need to know about the conventional factorial function to define it. This is a contrived piecewise function that IS well defined (by the mathematical definition, maybe not yours or xcthulhu's). Each integer x in the domain of all integers is mapped to a single value in the integers.
http://www.nntdm.net/papers/nntdm-19/NNTDM-19-2-30_42.pdf Section 3.1.
A mathematical exploration does not have to solve a problem. It can be done for the sake of the exploration. If everyone had the former view, we would not be where we are today in many fields, such as number theory providing the basis of all internet security.
Loading more items...