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.
Requirements:
should return 17 items
should have the correct column names
should have the correct values
should contain keywords
should contain SELECT
should contain RECURSIVE
should not contain !
should not contain CREATE TABLE
Beeing honest... I had to hardcoded it to pass it.
Helpful comment, thank you.
Well, you can use debugger while coding on your machine. Its what I do. Most of the time it requires to rewrite tests on your own, but I believe it makes me a better programmer.
Plus it will be realy hard todo for the random tests.
You can't write 2x1!
Please re-read the description.
So yes there's a trick to it?
There're two stages:
yeah
Good first step is to check how long the cicle is.
I don't think 'human readable' means what you think it means. It feels like you're just reciting from whatever guide you learned it from.
For tightly knitted stuff like this, as I said, a good balance between name readability and structure readability is hard. I'm not trying to bash you or anything, just to get you thinking about the benefit of short and concise code. Your original comment did seem like you think variables were shortened for completely no reason at all, and I was trying to say that it conveys the structure of the code better.
While it is usually a good idea to use longer appropriate variable names to convey information, blindly following this will not automatically lead to readable code. Here in your translation, the long names have the opposite effect, namely they drown out the mathematical operations and make it harder to figure out the structure of expressions.
For example, your
infected
equation is missing parens aroundnumberOfContacts * previousSusceptible * previousInfected - fractionOfRecover * previousInfected
. See how easy it is to miss stuff when everything is so long, and also how it's unwieldy to talk about what you wrote?A good balance between name readability and structure readability is hard. In my opinion the kata description is fine.
(I do hope that it was not just fear of maths that caused you to instinctively reject short names... That would be so unfortunate.)
You're right to be annoyed. I just don't understand why no one reported this problem before, or how that translation got approved at all.
It's not the kata's fault (well, sort of). I just noticed haskell translation is faulty and has no sample tests or initial code... Try another language.
D is the number of dimensions, N is the length on each dimension.
=> D=2, N=3 means a "2D squared array" 3x3. No contradiction with the description, afaik.
This comment is hidden because it contains spoiler information about the solution
Loading more items...