Ad
  • Custom User Avatar

    let's wait until some decision is made about these kata's

  • Custom User Avatar

    thanks, approved

  • Custom User Avatar

    You are free to make translations at will.

  • Custom User Avatar

    even better: the description should not mention the function's name, as it is irrelevant to the task, shown in the initial code, and naming conventions vary among languages. done.

  • Custom User Avatar

    There's this:
    https://www.codewars.com/kata/6378d155233c3f004a3bcef0/haskell

    Not sure if it's quite the same as minimising the bit count. Needs a Python translation in any case.

  • Custom User Avatar

    Hi brodiemark, I have inserted the missing loop. Thanks.

  • Custom User Avatar

    All I have to say is that I defer to the author and that I'll make any changes they want, or if they want to make them themself to skip the roundtrip time. The python output is the same as for haskell aside from using more it's.

  • Custom User Avatar

    How would the kata know on which word your solution fails? It's a black box that expects either True or False. Btw, if you pass sample tests, but not other tests, are there certain edge cases missing from sample tests?

  • Custom User Avatar

    You're right, as far as I know it's not possible to use reflection on lambdas in Java, so you do not have to include them.

    Retrospectively I think including those lambda tests was a mistake, as the way to check whether a function is a lambda relies on implementation details that are not guaranteed by the languages' specifications (they have the special name '<lambda>' in Python. In JavaScript it's even messier:

    (function(){}).name;            // ''
    const abc = () => {}; abc.name; // 'abc'
    (new Function()).name;          // 'anonymous'
    (() => {}).name;                // ''
    

    ).

  • Custom User Avatar

    Approved. Thanks for the translation.

  • Custom User Avatar

    updated to match. ready to go as far as I can tell.

  • Custom User Avatar

    Thanks for pointing that out. I just republished with a fix.

    We just need to make sure that when we place a 2-letter word (vertical or horizontal), we don't go off the edge of the board.

  • Custom User Avatar

    haskell version bug: this check fails

    it "mostly disconnected" $ do
      -- ... ellided
              length board `shouldBe` 225  -- fail SOMETIMES
    

    the python version has a band-aid fix to it, but I'll match whatever change you make (I have a local copy of the hs code so I'll diff it to see what you change)

    playAc may write out of bounds and make the board larger

  • Custom User Avatar

    Can you tweak the description so that the language-specific parts are correct for both Haskell and Python?

    I was going to pretend it was pseudo-code :whistles: .. it's not like it reads poorly and imo the main reason to turn descriptions "language-agnostic" is when things SMELL such as mentioning nullable references or if it starts naming different languages and the reader has to find the relevant part.

    Anyway, I added conditions such that it defaults to haskell but python is different.. I feel that it somewhat invites trouble to use this feature when others edit it later, so that's another point for pretending it is already pseudocode. A potential problem for later I suppose, depending on who next touches it xD. For now that should look good though. I do prefer conditions over rewriting it to actually be fully agnostic because I don't think that's an improvement over what's already there, that would be silly. I still lean towards keeping it as-is and only made this edit because of the explicit request. Whatever makes sense to you.

  • Custom User Avatar

    hello, thanks for your interest in this kata ! While passing a Predicate<Boolean[]> in parameter (together with an argument count and a name string) similarly to the C version is indeed an option, I think I would prefer passing a Method as single argument to the function, like the other languages, and let the users figure out how many parameters it takes and how to call it. there is a reflection/inspection component to this kata, and retrospectively i'd say the C translation was a mistake.

  • Loading more items...