Ad
  • Custom User Avatar

    Ruby version is working correctly. And you're most probably mutating the input.

  • Custom User Avatar

    I wrote this solution. I can tell you it breaks two tenets of javascript best practices of old: (1) avoid the comma operator and (2) always delimit blocks with curly braces. Whether these are still as relevant now as they were then is debatable.

    I've always held that the comma operator has its place in loop conditions. You should get acquainted with it. But in this case it's the wrong tool for the job. I've virtually never used it before, but I think this is a case for the do ... while loop.

  • Custom User Avatar

    Try using for loops instead of split + foreach. There are better ways of doing it too, but that should work.

  • Custom User Avatar

    There are many different kinds of parser problems, and this one is not those ones worthy of being a blue kata. This one doesn't even have precedence rules, and yes, even a slightly complicated regex will work very fine.

    Elephant in the room: there are many possible difficulties to a parser, which all depends on the grammar. Not anything marked "parser" is automatically "very hard". Please put up some better arguments next time before asking me why I downranked some particular katas ;-) I expected better from all of you.

    Voile is crazy with parsers

    Yes (if anyone can plug in a parser combinator library and finish all of them with just the slightest variations required, they're not very good katas), but irrelevant to this kata. I downranked it because it really isn't hard.


    Resolving because OP is basically saying the old "everything I can't solve is 1kyu, can you re-ranking it to such?", which is not a good judgement on the kata rank.

  • Custom User Avatar

    the funny thing is that upranking isn't possible either...

  • Custom User Avatar

    @FArekkusu :

    You should probably ask Voile for the reasons and not me. Though the Kata was a lil over ranked anyway. 4Kyu would have been better (after random tests)

    Following the same logic we should downrank Simple Interactive Interpreter from 1 kyu to 8 kyu because it has only 15 fixed tests :+1:

    :+1:, Well no more down-ranking is possible now, so :(

    You could always ask admins to do it. :)

  • Custom User Avatar

    Downrank kata because bad tests.

    Bravo. Instead of adding more fixed tests and random tests, let's simply downrank the kata, because that's what you should do to resolve the issue. Following the same logic we should downrank Simple Interactive Interpreter from 1 kyu to 8 kyu because it has only 15 fixed tests :+1:

  • Custom User Avatar

    @Blind4Basics :

    • Hum thanks for the explanation on that :). I think CW only has 30 to 40 Katas on that (way less than ones on FizzBuuz and other stuff)

    • I have no idea if they are same or different, I only did JS and they are overly easy (as in there are no random tests or anything). There are a total of 7-8 test

  • Custom User Avatar

    Voile: in any meaning you could use for that sentence. Crazy good, crazy hating them (edit: well, actually, what s/he hates is the fact that we have too much of badly done ones on CW), doing crazy thing with them, ...

    JS: what about them? too much easy? they are the same in all languages except the ones that donald did, Where there are more deep tests (and amidst them, except the PHP one where I had to cut off a part of the test suite becasue of a runner problem)

  • Custom User Avatar

    @Blind4Basics :

    seems we commented at the same time.

    Voile is crazy with parsers

    • you mean that in a good way or bad ?

    But sure, 5 kyu is a bit harsh

    • see test cases for more (JS ones)

    But these are not "common tricks"

    • Depends entirely on how you define common :)

    well, it can be done in 10-20 lines writting the parser from scratch, actually. x)

    • Well it was an overestimate since I saw 200 lines (approx) submission too. :)
  • Custom User Avatar

    it was 3 kyu. (EDIT: crossed messages with ___i

    The thing is ("are")...:

    • Voile is crazy with parsers (s/he is the warrior who downranked the kata. Well, now that I think about it, ZED is doing crazier things, about parsers x) )
    • this kind of task IS a nightmare as long as you didn't dig into it. After that, you realize that this is kind of an easy parser, this one. But sure, 5 kyu is a bit harsh. Let say it's a big one.
    • note that very clever tricks can be used to solve this without using a parser. But these are not "common tricks".

    This does require 10-20 lines and writing a parser from scratch for it shouldn't take over 100 lines (overestimate).

    well, it can be done in 10-20 lines writting the parser from scratch, actually. x)

  • Custom User Avatar

    @Farekkusu : This was 3kyu.

    @yannickjmt : As farekkusu said, this was downranked from 3 to 5 kyu.

    Now I'll comment on both of your possible approches :

    • This Kata can be solved using regexp and rather easily as well and yes it is possible for human beings. Not sure what defines normal so I can't answer that.
    • This does require 10-20 lines and writing a parser from scratch for it shouldn't take over 100 lines (overestimate). Though there is no need to write one.

    Nope, you are not missing something, only that they should have probably downranked to 4Kyu and not 5Kyu but I think this is fine as well.

    Note for Farekkusu :

    The ranking was not wrong, see test cases for more (at least JS test cases)

  • Custom User Avatar

    This kata was (IMO wrongly) downranked a couple days ago from 4 kyu (or was it even 3 kyu?) so it's not suprising that you find it frustrating.

  • Custom User Avatar

    Finally, all fixed ;-)

    I also added random tests and fix all the Test.expect in every language.

  • Custom User Avatar

    Fixed some language versions. Still fixing the rest because some translations are cough very poorly written.

  • Loading more items...