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.
not work
Would it be better to use
''
thanNone
?This comment is hidden because it contains spoiler information about the solution
I was baffled by this signature of the
translate
method until I realized "Python" here means Python 2.superb :D
it works in python 2, but not in 3
Can you please publish your code? This solution works fine for me, so I'm even eager to know what is the reason it doesn't work for you.
This looks like a great solution, however, I tried this on my own machine and got the following error:
Traceback (most recent call last):
File "", line 1, in
TypeError: translate() takes exactly one argument (2 given)
Is there a piece of the solution missing?
Im just not big on reinventing the wheel, but you're right there is nothing wrong with the Kata.
Ok fair enough. And yeah i shouldn't have marked it as an issue. Sorry about that.
This is the last kata in a series, and, as such, it makes you use all the things you learned in the series. Part of that is converting from a String into an IntStream and back again (a common task in Java streaming). There's no "essentially" about the programmer writing their own flatMap function; that's a specifically defined part of the kata.
Further, it's essentially a translation of another kata of the Dragon's Curve (http://www.codewars.com/kata/dragons-curve), but forces the use of Java streams. As such, it keeps to the contract of that kata as much as possible, which is also heavily reliant on String manipulation and String out.
Finally, a stylistic complaint is a "Suggestion", not an "Issue".
The use of Strings throughout the program rather than IntStreams prevents the use of the "flatMap" function in the IntStream class (because mapFunction must return an IntStream, not a String). This means the programmer must essentially write their own "flatMap" function to use Strings which is unnecessary. Also, converting from an IntStream back to a String is a pain and it unneccesary in the case of the creation of the dragon curve. Just use IntStreams instead of Strings and this Kata is pretty good.