Ad
  • Default User Avatar

    I just tried the kata and I had no problem at all. Furthermore 74 guys passed the Clojure kata. Could the problem be in your code?

  • Custom User Avatar

    You are thinking of each value in the kernel as a per-color channel value, but that is incorrect. Each value is a per-pixel value. Maybe I can draw it out more clearly:

    When we first start, the kernel should be centered on A:

    [A(edge) * 0.2][A(edge) *  0 ][B(edge) *  0 ]
    [A(edge) *  0 ][   A    * 0.2][   B    * 0.2]
    [C(edge) *  0 ][   C    * 0.2][   D    * 0.2]
       
    

    So then per channel, our formulas end up being:

    newRed = 0.2*[A edge red] + 0*[A edge red] + 0*[B edge red] 
          + 0*[A edge red] + 0.2*[A red] + 0.2*[B red]
          + 0*[C edge red] + 0.2*[C red] + 0.2*[D red];
    newGreen = 0.2*[A edge green] + 0*[A edge green] + 0*[B edge green] 
          + 0*[A edge green] + 0.2*[A green] + 0.2*[B green]
          + 0*[C edge green] + 0.2*[C green] + 0.2*[D green];
    newBlue = 0.2*[A edge blue] + 0*[A edge blue] + 0*[B edge blue] 
          + 0*[A edge blue] + 0.2*[A blue] + 0.2*[B blue]
          + 0*[C edge blue] + 0.2*[C blue] + 0.2*[D blue];
      
    
  • Custom User Avatar

    Maybe you edited the example test cases accidentaly (or intentionally) and now it has some bracket issue? You can try "reset" button (but make sure to copy your solution before that, as it will be reset as well).

  • Custom User Avatar

    I tried it again today and still can't recreate your problems.

    I will mark this issue as resolved. Please let me know if you still have problems!

  • Custom User Avatar

    It hasn't changed recently and it works perfectly for me.

    Your error message is almost always the result of unmatched braces. The opening brace is probably at line 6, and the compiler can't find the closing one.

    Please check your braces (and double-qoutes around your strings) and let me know if the problem persists.

  • Default User Avatar

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

  • Custom User Avatar

    @jnicol This "res variable"... what language are you doing this kata in? Python does not have a "res variable" :-(

  • Default User Avatar

    It prints nothing, but that doesn't mean you haven't been returned anything. Look more closely at your res variable...

    You're half way there!

  • Default User Avatar

    Yes, it is normal that this prints nothing. But it doesn't mean you can't do anything with it ;)

  • Custom User Avatar

    Hi nha, well, I believe I'm too late to apply a regex to the function body and strip out comments. I think it isn't worth the risk of an accidental solution invalidation. You still can place your comments outside the functions body :).
    As for the segment1 given solution, you are right. I've corrected the preloaded solution giving the more accurate and meaningful segment7 solution.
    Thank you for the hints.

  • Custom User Avatar

    Please - everybody upvote the "fork"-option for the katas. I'd LOVE to adjust the description - it's just that I can't, because the Kata is in "play-only" mode :(

  • Default User Avatar

    Actually, I understood that only ASCII-characters should be counted, and I was later stunned by the fact that almost no other solution bothered about this.

  • Custom User Avatar

    Well I might change the kata description so that the solution also accepts all the UTF-8 characters, I think this would be better ?