Ad
  • Custom User Avatar

    Quite sorry for the late response, I have been somewhat MIA here.
    First of all, thank you. This post pointed out one of my assumptions that is probably causing confusion for some people; I am relying on the user being familiar with the Codewars provided objects (Test and console).

    For the details on the test framework used by Codewars, take a look at http://www.codewars.com/docs/js-slash-coffeescript-test-reference .

    You can use console.log(BlackKnight) in the code you type for your solution, and it will show some basic output in the response you get from the codewars server. Once you can get output, it should be possible to iterate over the keys of the BlackKnight object and output their corresponding values, and that should help you on your way. I'll restate you can't use the browser console because of the way Codewars works.

    I hope the above made some sense... If not, feel free to let me know, and I'll see how I can clarify.

  • Custom User Avatar

    Yea, I felt the same. I think it shows in the solutions as well, there's a lot more variation than with most katas (more than one way to skin a cat, and all that).
    This is one of the few times where my solution wasn't fairly similar to someone else's.

  • Custom User Avatar

    BlackKnight is prepared before your code. Doing a console.log(BlackKnight) should show you that the object does exist.
    I don't want to give away too much, but (at least for easy difficulty) you should be able to solve the kata simply by inspecting that object (there are many ways to do this; you could iterate over the object properties, for example).

    If BlackKnight was undefined or something for you, that's a fair sign something went wrong with the kata setup. In that case, would you mind letting me know? If you can't submit the kata, please post your code (marked as spoiler) below.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    I do actually use the reply button. I think it has something to do with the preview tab (when I use it, I tend to jump out of the thread), but I haven't been able to reproduce it consistently so far.

  • Custom User Avatar

    ... And for some reason, most of my replies end up as separate threads. Bummer.

  • Custom User Avatar

    Thank you for your feedback.
    I'd say the purpose of the kata is to figure out a way to bypass a mechanism that you have no control over, without explicit instructions. In that way, I suppose it is incomplete on purpose, yes.

    Please don't take offence at my previous comment; what I meant was that you have

    // The black knight will be more persistent depending on the difficulty you specify.
    // Possible difficulties are easy, medium, hard, harder and impossible.
    // Default is easy.
    difficulty = 'easy';
    

    at the top of your submitted code. As the comments state, you can change that to (for example)

    difficulty = 'harder';
    

    and the solution you wrote wouldn't pass. The difficulty setting is mostly an experiment to allow you to try and get as far as you can while still being able to submit your solution if you get stuck along the way.

    If the difficulty thing was not obvious for you, please let me know. It might indicate that I should move the explanation for that to the description.

  • Custom User Avatar

    Yes, that's exactly the point of the kata (by the way, your solution would only work for the easier difficulties). Is there any particular part of the description that isn't clear enough for you? Is there any suggestion in particular that you would like to make?

  • Custom User Avatar

    Ah, you were talking about the Ruby problem, not the javascript version. That explains why I didn't understand your question :) I'm afraid I have almost no ruby knowledge, the ruby version was added by jhoffner (I think).
    Just for the record, you can embed code using the following:

    ```ruby
    class Class
    # Your code goes here
    ```
    
  • Custom User Avatar

    Well, as far as I'm concerned, anything goes. That was the original purpose of the impossible difficulty, and I intend to stick with it. Of course, if I made a dumb mistake in the setup that made it absolutely trivial to beat impossible, I might have fixed that. But seeing as this is the only submission for impossible so far, I think this is a perfectly acceptable answer. Of course, the fact that it uses the exact same technique as the easier difficulties (just one level higher up the chain), makes it all the sweeter (and makes me curse myself for missing it).

    So yeah, anything goes, unless everyone can figure it out within minutes.

  • Custom User Avatar

    Oh wow, I totally forgot to store Object.defineProperty...
    While I'm tempted to fix the setup, this answer is entirely within the spirit of the kata, so I'll have to let it be. Awesome!
    You are indeed brave, sir knight!

  • Custom User Avatar

    So, I've opted for an approach with a couple of difficulties. Why?
    Mostly because I noticed in the "You shall not pass" kata (on which this kata is based) some people were unable to complete the kata, and therefore unable to participate in the (interesting) discussion that occurred behind the curtain.

    I figured it would be better to let everyone in, and just make the problem as challenging as you want to make it.
    One problem this does create: I'm not quite sure what rank to give this kata. While I wouldn't assume too high a rank for anything but impossible, there is still quite a gap between easy and harder.

    I'd love to hear what you think!

  • Custom User Avatar

    For anyone who liked this one: I've tried to recreate the essentials of the problem without relying on any Codewars vulnerabilities.
    You can find the new kata at http://www.codewars.com/dojo/katas/525988ee6021e918e6000dce/ .

  • Custom User Avatar

    Oh wow, I thought it was going to take at least a little more time before someone passed again. This one actually makes sense to me as well. Congratulations on a clever solution!

  • Loading more items...