Ad
  • Custom User Avatar

    Looking at this kata but haven't tried it yet. That said, the parser would know how many parameters the function needs when it sees its name. Thereby knowing how many expressions to parse to be able give it the parameters it needs. Keeping in mind that an expression would continue to parse as long as it possibly can and still being a valid expression. Thus the parser would parse two subsequent expressions (resolving "2 + 5" and "3" respectively) and give them to the function, evaluate it, and continue on.

    It will not stop at just the "2", because "2 + 5" is a valid expression; it will however stop there, because "2 + 5 3" is not a valid expression (as per the grammar).

    I hope that makes sense.

  • Custom User Avatar

    issue 6 years old, author incactive, 322 warriors solved it, translated to other 2 languages, I am presuming, based on these fact, that description is ok. I am closing this issue, as it is stopping kata with 88% rate from further progress in beta process. If anyone disagree, please do suggestion or fork with better description.

  • Default User Avatar

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

  • Custom User Avatar

    I've fixed the Rust translation, sample tests should now correctly use Options in the assertions. A reset of the trainer might be necessary to see the changes if you've already started training on them, however I wouldn't bother since the actual test suite is not affected by this issue.

  • Custom User Avatar

    This is very odd, since the approved translation has correct sample tests. Not sure how these (outdated) sample tests show up when entering the trainer. I'll look into it.

  • Custom User Avatar

    Approved, thanks.

  • Custom User Avatar

    I'm mostly ok with it (I wouldn't say what you have to return twice, but if you think it's really needed...), but I'm not sure if "ohell" is left rotation of "hello" (I know the author said that), I'd say that's a right rotation, here is my interpretation (and I saw it like that in some places too):

    hello -> rotate right 1 position
    ohell // all chars are moved one position to the right, the o exits from the right and enters by the left side
    

    Now let's see what @antrianis thinks.

  • Custom User Avatar

    Suggest a better description then, kata's author is active so he can improve it.

  • Default User Avatar

    in my opinion, a kata should be descriptive enough to not allow for "different interpretation" from most of its takerstakers

  • Custom User Avatar

    Write to function that takes as argument two strings and returns positive (True/true/1) if one string is a rotation of the other or else it returns False/false/0.

    Why would you need to differentiate what kind of rotation it was? IMHO it's not a kata issue, it's your wrong interpretation.