Ad
  • Custom User Avatar

    AI was very handy in generating all of 1-19 and 20-90 without doing it by hand :)

  • Custom User Avatar

    I accidentally implemented mult as pow and didn't realise because the test case for mult said it was correct (2*2, 2^2)

  • Custom User Avatar

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

  • Custom User Avatar

    You're making errors. In Haskell, there is no error tolerance.

    Order of operations is specified. The random tests conform to these specs, and they use exact comparisons.

    Error tolerance is for situations where the order of operations is not specified.

  • Custom User Avatar

    What is the purpose of disallowing print and sys for Python?

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Haskell:
    'expected -7.438096897115541 but got -7.438096897115539'
    Possibly I'm making errors, but on the random tests it's always slightly off.
    Should the error tolerance be increased for the random tests? Other issues mention 1e-06, but these numbers' difference is clearly < that.
    Perhaps it's due to the me parsing a string to a double character-by-character and not using read.

  • Custom User Avatar

    Note that Test Cases and Sample Test Cases both need to end in "Spec", but need not have the same name ( they can, and barring typoes, I always do though ).

    Also, you can use dots in names, so you could also do e.g. "$KataName.Solution", "$KataName.Preloaded" and "$KataNameSpec" ( but not "$KataName.Spec" because the unqualified part can't just be "Spec" .. sigh ).

  • Custom User Avatar

    Yeah, you got unlucky. Most kata use QuickCheck instead of Random; it's the expected standard, and there is something against using Random though I don't know what exactly ( possibly it's slow, but I think QuickCheck uses Random under water anyway ).

  • Custom User Avatar

    Modules should have unique names except for the test suites, and, specifically on CodeWars, the test suites' names should end in "Spec".

    I usually name the solution "$KataName", the test suites "$KataNameSpec" and Preloaded, if there, just "Preloaded". ( You can also leave Preloaded completely empty. )

    Preloaded can be imported in Solution and Test Suites ( separately ).

    I'll try to do a fork. ETA: I did. ( If you can, please reject that. Can't do that myself. )

  • Custom User Avatar

    Yeah I kinda just looked at another Haskell kata and used the same testing format; I guess I got unlucky and picked one that didn't use QuickCheck.
    Test code is just normal code that's not intended to be clever, but I'm flattered nonetheless.

  • Custom User Avatar

    I spent many frustrating hours trying to get the whole thing to be accepted and this was the only way it would even accept the code (see comment at the top of the preloaded code). It seemed to not let it submit because the 'solution' was not correct unless I also preloaded the solution. Absolute pain :/ . What should the modules be called?

  • Custom User Avatar

    I've submitted the beta to the mods to retire

  • Custom User Avatar

    Your Initial Solution uses the wrong module name.

    Preloaded is not the place for the reference solution anyway. ( The user solution could just import and reexport it, and "solve" the kata that way. ) This is documented!

    Not good. :/

  • Loading more items...