Ad
  • Custom User Avatar

    The general form ended up working for me, I did have to mess with the ordering though

  • Custom User Avatar

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

  • Custom User Avatar

    same comments as on your other translation, plus:

    random tests give unreadable failure messages to beginner solvers. forAllBlind, a custom generator, and Test.HUnit.assertEqual should be able to give good failure messages. If you want an example, I just fixed up https://www.codewars.com/kata/5865918c6b569962950002a1/haskell ( you should be able to solve that rather quickly if you havent yet ).

  • Custom User Avatar

    for an 8kyu kata, please show inputs in failure messages ( look into Test.HUnit.assertEqual ).

    also, please factor out the reference solution from the random tests ( for maintainability ).

    ooh, and make imports and exports from the user solution module explicit. imagine a scenario where solver exports it accidentally. import helpAlex only to the test module, and export helpAlex only from the initial solution. help beginners develop good habits.

  • Custom User Avatar

    Puzzling out leading-0 edge cases was interesting.

  • Custom User Avatar

    Cool concept, tests are annoying though.
    I don't like that certain simplifications are required,
    such as tan(x)' equaling 1 + tan^2(x) rather than sec^2(x).
    Also (* x x) is rejected because of (^ x 2).

    More nitpicky:
    f(x)^g(x) => (g'(x)ln(f(x))+g(x)f'(x)/f(x))(f(x)^g(x)) is the general form (which works for monomials as well)
    but I needed to hardcode in the specific monomial form to pass some tests.

    That may be an interesting problem on its own:
    Check if two functions that only use: constants 'x' + - * / ^ cos sin tan exp ln
    are equal.
    Though idk if that's even possible/decidable.