Ad
  • Custom User Avatar

    Clojure version's witheld tests assume a helper function "div?" exists, which was only revealed via stracktraces, and whose purpose and argument order had to be guessed.

    Example test cases would also improve the quality of the kata.

  • Custom User Avatar

    Thanks for the reply, well argued on each point. See now that n+1 does make sense if you think of it like an L1 norm.

    Generality is great - maths get only more sublime as it's abstracted. My critique was around needing to parse a long informal explanation to find the problem statement midway - at a glance I was first confused at how to integrate 'n', before realising I was not to write a general integrator or to return a curve or y value.

    Maybe I was just in too impatient a mood, thanks for an unusual problem and a constructive response

  • Custom User Avatar

    Notation is confusing - mixing X,Y and y,t co-ordinate labels. Probably easier to introduce the particular equation instantly rather than trying to define the general problem.

    Decision to truncate instead of round to 6 digits seems odd, and only examples made it clear that this really was what was wanted.

    Calculating average errors as sum / n+1 also seems odd, there will never be any error at y0, so sum / n makes more sense.

  • Custom User Avatar

    Looking at latest answers, see how varied the solutions to get around the issue were. Eg. dudymas' use of a callable Class, or peatey using the function's internal name. Think finding a solution to the repeated application case is just "part of the fun" in the end.

    Perhaps a small paragraph about ambiguity when calling on variadic functions would be useful.

  • Custom User Avatar

    Needs some polish to make it out of beta for Python IMHO

    There are some typos in example code (eg. curriedAdd(add)), and no unit tests. I realised the typo because I used the inline examples. Codewars is printing functions as empty strings, so found this particular mistake annoying and took me a while to debug.

    The repeated application of the function converter (curryParial(curryPartial(fn))), I found that tricky because of losing an easy way to read the original arity. Thought of setting some kind of property on function, but new to Python and wasn't sure how. See how now from other answers, but also quite a few people got lazy like me and just used exception handling instead. Not sure the value of handling this contingency anyway, since currying + variadic doesn't make much sense, and double application of currying would be a no-op and something to avoid.