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.
Yeah, it took me a while to realize that... Using pen and paper always now...
The code above isn't formatted properly and can't be considered as "Best Practices".
Google(https://google.github.io/styleguide/javaguide.html#s4.6.2-horizontal-whitespace) advises to have whitespaces "On both sides of any binary or ternary operator."
Oracle(https://www.oracle.com/technetwork/java/codeconventions-150003.pdf) advises the same: "All binary operators except . should be separated from their operands by spaces."
if the path was 5 norths and 5 easts, your code would say it was a valid path.
I agree. I think the author doesn't know that a null string is not the same as an empty string. In Java, we have:
String aNullString = null;
String anEmptyString = "";
aNullString.equals(anEmptyString) returns false.
Is there a drunkenDoodling method for the Java version? I tried both drunkenDoodling(str) and drunken_doodling(str). Both times, the compiler says it cant't find the function.
This kata is beautiful now!
Description modified with examples in each language. Hope that @cuyaken will have happy coding^_^
I saw your point, I messaged the translator. It's going to be fixed.
What I am trying to tell you is that the Java version of your kata doesn't follow the form of most katas.
Here is what I see for your Kata (there are no examples, even though it says "Let's see some cases:"):
Description:
We need a function prime_bef_aft() that may give the largest prime bellow a certain given value n, befPrime/bef_prime, and the smallest prime larger than this value, aftPrime/aft_prime. The result should be output in a list like the following:
If n is a prime number will give both primes, n will not be included in the result.
Let's see some cases:
Happy coding!!
I'll talk to the translator into Java to include these cases in the description. Just to follow the style I have for the katas.
I didn't make the translation in Java. I created this kata originally in Python. But let me ask you something, do you consider of extreme importance having the same cases twice, in examples and the description? I did it in most of my katas, but someone asked me: "It's redundant to have the same cases in both places, why do you do that?"
Those are not in the problem description in the Java version. The are only in the test. Look at other postings. Other postings list examples in the problem descriptions. One of the criteria for judging if a kata is ready to go beyond beta is that it have examples.
Is it enough for you?
You have these given examples in the details:
The description does have examples with expected results.
one of the expected things in the problem description is examples of the expected results. For example, "prime_bef_aft(4) should return [3,5]"
Loading more items...