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 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.
This comment is hidden because it contains spoiler information about the solution
I think I see what you want to do here. Should using unrelated geneators running simultaneously in parallel threads work?
I don't this this kata requires that, but it would be nice anyway.
This is not functional programming, please remove that tag.
It seems like a lot of katas have irrelevant tags to attract users, and no way to deal with it. It ruins my experience when my first task for every kata is to figure out if it's even relevant, and most of the time it isn't.
I agree, it's a mess. But you could use your browsers search function. :)
I don't see how this is related to any of the following tags: LAMBDAS, FUNCTIONAL PROGRAMMING, FUNCTIONS, DECLARATIVE PROGRAMMING
I also think DATA STRUCTURES is a bit of a stretch.
Most of the reference implementations doesn't even use functional programming.
I see now that this has been reported before, and was closed without solving the issue. I only checked open issues before reporting.
This comment is hidden because it contains spoiler information about the solution
The test for
filterS
has false negatives.In Java, mod of a negative number gives a negative result (or zero). So if
start
is -7 thenpos
is set to -1. Add that tostart
, and test expects the first number in the stream to be -8. This should of course be -6.I suggest
int pos = start % 2 == 0 ? 0 : 1;
orint pos = Math.abs(start % 2);
.