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.
Despite all the people who have passed the tests...
Yep, you've identified the issue. Although technically, we've proven that DECODING should test both -- or at least should test whether, if you have errors in encoding, you have the exact-reverse error in the decoding. :/
OK, Ramunas, I think I get what's going on — it comes down to my test fixture using your own
toAscii85
andfromAscii85
methods to figure out what's expected. (And this is clearly not ideal; I hadn't thought about that until now.)So, when it's testing your ability to decode random binary data, here's what happens under the hood:
toAscii85
method, and store the resulting ASCII85-encoded strings in another array;encodedObject.fromAscii85()
(which is the "my result" value) to the object stored at the corresponding location in the decoded array (which is the "expected" value).So, looking through what's happening to you, the issue is:
toAscii85
method, so that's where you should look for the error.Does that make sense?
Ramunas, that's weird — I get the same thing you do, but don't know where my code would expect that result you're saying it does. Did it happen a second time?
Might I suggest then that you give the ASCII85 encoder/decoder kata a try? :)
http://www.codewars.com/dojo/katas/5277dc3ff4bfbd9a36000c1c
Nicely done, and I love the backwards-compatibility shim you added!
Nice kata -- my only comment is that
make_process_tree
isn't very Javascript-like, where functions are typically camelCased rather than underscore-separated.More better! :)
I think the kata's ready, but would ask one question: why the weird return string, rather than just returning the converted value itself?
Agreed with the issue that you need to make clear that the value passed to the constructor is a string, both by stating so explicitly and by updating your examples.
Agreed that returning NaN from a
toString()
call is nonsensical — perhaps it should throw an error, but it shouldn't return a non-string.Overall, this whole kata feels like an exercise in nonsense; I can't imagine any time when this would be a handy class to have in your toolbelt.
Um, I thought regex was disallowed? At least a handful of the already-submitted solutions use it...
Boom --
Object.getOwnPropertyNames
now works as well (http://www.codewars.com/dojo/katas/reviews/52859abdf8fc1b12e0000144/groups/52868629affb2c31a1000cf7). Baffling, though, that it iterates in a different order!Awesome. I'll try to submit my solution but using
Object.getOwnPropertyNames
and see what happens!This comment is hidden because it contains spoiler information about the solution
Your test harness is expecting the keys of the object to appear in the exact same order, which I'm finding is fine with the exception of your random-input test — for some reason, I'm unable to return an object that has the keys in the order you're expecting them. But it leads me to ask: why are you expecting the keys of the returned object to be in any particular order?
Loading more items...