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.
Ruby version is working correctly. And you're most probably mutating the input.
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.Try using for loops instead of split + foreach. There are better ways of doing it too, but that should work.
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.
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.the funny thing is that upranking isn't possible either...
@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)
, Well no more down-ranking is possible now, so :(
You could always ask admins to do it. :)
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
to8 kyu
because it has only 15 fixed tests@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
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)
@Blind4Basics :
seems we commented at the same time.
it was 3 kyu. (EDIT: crossed messages with
___i
The thing is ("are")...:
well, it can be done in 10-20 lines writting the parser from scratch, actually. x)
@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 :
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)
This kata was (IMO wrongly) downranked a couple days ago from
4 kyu
(or was it even3 kyu
?) so it's not suprising that you find it frustrating.Finally, all fixed ;-)
I also added random tests and fix all the
Test.expect
in every language.Fixed some language versions. Still fixing the rest because some translations are cough very poorly written.
Loading more items...