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.
Amark, please, could you advise me what should I put to the board?
I have written the solution, but my algorithm does not work because I expected that board will be as [start, diskQuant] :(
Should the object constructors return values?
This comment is hidden because it contains spoiler information about the solution
Well one could write for example a power function with an input for the power of 2 for square and 3 for cube.
Same with modulo and even/odd.
Therefore I am okay with similar functions.
I looked at this kata and was turned off by the syntax of
'some string'.toAscii85()
Modifying the built-in
String
prototype just isn't something I approve of. Multiple libraries modifying built-in prototypes can cause all kinds of pain. A much better solution would be to make a function that takes a text string as an argument and outputs Ascii85.I don't mind having to essentially re-type the similar functions. For me it just helps re-enforce the concept and help commit important methods (and how to use them) to memory.
I also found it a little bit boring to have to do so many similar functions. Would have been better to skip for example the square() and the even() methods.
Agree with this point. Data as the first input and then sortBy as the second.
I also handled the three character hex descriptors, should be more explicit in the description ;)
I see what you mean. You're right. If Function.prototype.toString is overriden, then my trick to detect a literal regexp doesn't work (which means the regexp check can be bypassed).
I was hoping for a minimum of fair play, but I'll update the kata the prevent such bypass: Object.freeze(Function.prototype);
Hmm this makes me think that maybe another bypass is possible by using eval. However that would be crazy shit. I'm not gonna dig too much on that for now.
Did you make sure to freeze the Function.toString method for your /^[^]*$/ trick?
This comment is hidden because it contains spoiler information about the solution
Okay, fixed. (I'm more of a python person.)
Looks like there was errors on the site in general at the time. How are things working for you now, Delfuego?
Thank for the feedback guys.
I've updated the solution to check for both literal and object notation of RegExp.
-> JulianNicholls & OverZalous solutions not longer pass the tests.
Object notation was easy to forbid since RegExp is overridable.
For the /regex/ syntax, I'm using a trick which hopefully we'll not block legitimate code.
Let me know if you think that's the case.
I was more worried about the possibility to do something like that :
I've explicitly forbid to concatenete calls to getChunk in the test description, but it is technically possible...
It is possible to pass the test without .split(), but that's ugely restrive.
Let me know if you see a proper way to do this...
Loading more items...