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.
The problem is somewhere else but I have no way of knowing where
Thank you, I´ll look at it :) Although I think I understand the visibility and accsess modifiers in Java, I just didn´t know it´s possible to declare more classes in one file and the rules around that.
If you need more info about various visibilities in Java
https://iq.opengenus.org/public-private-protected-in-java/
Interesting. Thanks for sharing!
So the solution was just to remove the public modifier :) Well, at least I´ve learned something new about java.
Thanks for your suggestion. It would be quite strange solution for java... but I´m gonna try it.
I don't know much about java, but I think the only way is to declare those classes private inside the main class (Leetspeek class in this case).
./src/main/java/Leetspeak.java:31: error: class Encoder is public, should be declared in a file named Encoder.java
public abstract class Encoder {
^
./src/main/java/Leetspeak.java:35: error: interface Dictionary is public, should be declared in a file named Dictionary.java
public interface Dictionary extends Map<String, String> {
^
./src/main/java/Leetspeak.java:39: error: class LeetspeakDictionary is public, should be declared in a file named LeetspeakDictionary.java
public class LeetspeakDictionary implements Dictionary {
^
3 errors
I really tried to make an OOP exercise out of this kata. And of course, in my IDE every class has its own file. But how am I supposed to submit my result here correctly?
The escaping characters and the null parameter made it tough for me. Nice task though!
If the translation is that bad (which happens quite often with Java->Kotlin translations), it must be improved or not even accepted.
Is there a process to give better translations?
And that's definitely why this Kata is marked as 6kyu
I gotta say, having to deal with some abstract class is just a distraction that takes away time from the actual task and I can't see any benefits of it. I'd like to also echo @ChristianECooper's comment from 5years ago.
The Kata was designed for Java and was translated by community to Kotlin, that's why some constraints seem illogic when coded in Kotlin.
Really, this is one of the worst Katas, at least for Kotlin, I've stumbled upon.
These Katas should train people to code properly, it is extremely important to me that the code presented is already on a very good level.
Why on earth must Leetspeak be derived from this abstract Encoder class? Makes no sense and is not given by the setup and only fails the hidden tests.
Why on earth do you do encode on a nullable string and expect that to return an empty string? This is Kotlin! Use the power to make clean interfaces!
Why on earth do you write a test with assertTrue and then put a comparison in the actual part? Use assertEquals!
Really, had no fun doing this one. The expected code is very simple, but the setup is really bad. Wish I could at least fix the issues in the Kotlin translation.
At the beginning the class Leetspeak is declared as an independent class instead of being an inheritor of Encoder. Just "extends" is needed.
Loading more items...