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.
There are random tests, but their order is completely deterministic: it's always
truefollowed byfalse. So it's not really random at all, even a deep learning algorithm can learn to pass this.This kata is a duplicate to many existing katas ("cycle check" and "dependencies" are very common keywords in katas...)
love this solution, I thought the same but yours so CLEAN. Love it, you clearly a genius
For consistency, should hash values will be an Array?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Another good catch :)
Thanks for the quick update! However, your
reset_complete!now does the same thing ascomplete!;) It doesn't set@completetonil.Good points, I've updated the challenge. This is likely going to break a number of existing solutions.
Ah ha! Yes, the verbs used by the generator were not all in present tence. Fixed, thanks!
Changing
enteredtoenterandrespondedtorespondshould do the trick ;)Interesting kata. However, I found the description being confusing. You specify "the block passed in to
attr_lazyshould only be called, and its value applied to the variable, if the variable is nil." Yet your test cases specify that blocks should not reevaluate even if the block returns nil. What's probably meant and what most people understood is "... if the variable is not defined".I also noticed a small mistake in the test case
should not call the block if the variable is set manually. You set@completemanually usingcomplete!but you don't callcheckorcomplete?afterwards. Therefor the case doesn't test anyAttrLazyeffects at all.complete_checked_atis alwaysnil.Also I suggest adding this test case:
My first solution actually allowed evaluation of the block if the variable was manually defined and set to
nilbefore. All current tests pass but it's probably not the expected behaviour. The suggested test covers this scenario.I see. I didn't do the ruby translation, and the js seems to work fine. You seem to be a lot more useful than me at potentially fixing this. Could you suggest a way?
It's a mistake in the random test data. Check the
verbsarray in the ruby translation tests cases:verbs.grep(/ed$/) =>["entered", "responded"]. It should only contain verbs not already ending ined.Hi ojundt, thanks for your message. I can't replicate the error you have. Are you sure you are not defining any global variable?
Loading more items...