Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    They are only needed whenever you aren't just using a simple variable. An example is "hello, ${person.name}" or "hello, ${name.replace("a", "b")}".

  • Custom User Avatar

    When is it neccessaryly tu use them? My attempt worked without them.
    Thanks for reply

  • Custom User Avatar

    sure you're right👌
    just in learning cycle😉

  • Custom User Avatar

    Curly brackets in a string template are redundant for that particular case.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I am too lazy to modify sample cases for all translations. The most of them weren't even created by me. And probably even if I will try to modify it, there is so many solutions already, so I would probably hit a timeouot from CW.
    And this kata is a part of collection. So .... it's too late already.

    I guess you had this issue becasue you started from the second kata in the Alphabet war collection. All katas in this collection have similar rules.

    BTW. Try other katas in this collection! And thanks for your suggestion ;)

  • Custom User Avatar

    Ah, ok, I completely missed that. Thank you for pointing it out!
    IMO that line was easy to glance over, or misunderstand. I think I interpreted that they weren't even part of the kata at all.
    I think I made that misunderstanding because of a combination of:

    • only weighted letters are in the score table
    • only weighted letters are used in the sample tests
    • non-weighted letters only appear in the full-attempt tests, in the random test case. (It was easy for me to make the assumption that the random test case was buggy, and introducing characters it shouldn't)

    Do you think it would be a good idea to add a test cases with non-weighted letters to the sample test cases then? I think that would help people understand.
    Unless part of the fun is reading closely, and only finding out about the non-weighted once you do the actual attempt!

  • Custom User Avatar

    Please try to read my description again.
    "(...)The other letters don't have power and are only victims (...)"

  • Custom User Avatar

    For the Java kata, the given sample test cases work fine because they only use the given left vs right side set of characters.

    The issue is: the random test cases generate random characters. I think this makes no sense since we don't know the weighted values of those characters. The given letters in the description are weighted in power, so we can't possibly know what to weight a random character. We also aren't told to just treat any other character as a default of one, or anything like that.

    So, I think this kata is broken for Java. You can't possibly pass the random tests which are using random characters in the fight.

    EDIT: Actually, after trying some stuff, I got it to work by not considering the values of random characters at all. Maybe that's something you should put in the description... I had to guess that other characters could be ignored, then try it out and see if it worked. I had no idea that's what I was supposed to do.

  • Custom User Avatar

    This solution that you've commented on correctly deals with starting and ending spaces. Try it out by forking the solution and adding a test case with leading and trailing whitespace.

  • Custom User Avatar

    The opposite of -2147483648 in a int does not make any sense, so it's out of spec.

  • Loading more items...