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.
This comment is hidden because it contains spoiler information about the solution
(also, a bunch of existing solutions just got trashed by the null yields test... rip)
thanks, i've added your new tests. i've also added a note to the description warning that yielded values may be
null
this kata isn't really meant to test for multiple threads of execution, but i suspect using
static
variables to store generator-specific data will likely fail in cases with multiple generators anywaysa good implementation probably should allow for unrelated generators to run in parallel threads, but this kata doesn't require or test for that
For those stuck, i found it helpful to visualize whats happening with a pen and paper.
see here
see here
Tags are mostly automatic (and bad, yes), don't post suggestions about that, it's useless. Thx.
This is not about refactoring, please remove the tag.
This is not about refactoring, please remove the tag.
This is not about refactoring, please remove the tag.
Don't you think it's incorrect to tag it "functional programming"?
Or don't you think incorrect tagging is an issue?
This comment is hidden because it contains spoiler information about the solution
You could also test yielding null-values, with and without combining with yieldFrom.
When a generator is done, next() should return null. But if yielding null the generator might not be done.
Loading more items...