• Reported on github.

  • make is no longer accessible in solutions.

  • I've noticed several similarities to questions from practicepython.org and SoloLearn. Needs to be cited, agreed.

  • Usually I think codewarriors add what is needed and lots of guys passed the kata as it was and nobody complained.
    I just added "#include cmath". Thanks!

  • In the example tests just test against fixed values. If the return type is too complex for a one-line cr_assert_equal add a test function (which can also provide better error messages and cleanup):

    #include <criterion/criterion.h>
    unsigned long long* eval(unsigned long long n);
    void test_eval(unsigned long long input, unsigned long long expected1, unsigned long long expected2)
        unsigned long long expected[2] = {expected1, expected2};
        unsigned long long *actual = eval(input);
        if (actual)
            cr_assert_not(memcmp(actual, expected, sizeof(expected)),
                "eval(%llu) should return {%llu, %llu}, actual: {%llu, %llu}",
                input, expected1, expected2, actual[0], actual[1]);
            cr_assert(actual, "eval(%llu) should not return NULL", input);
    Test(eval, should_pass_all_the_tests_provided)
        test_eval(2134563, 246, 1353);
        test_eval(20468, 20468, 0);

    Having this test function in the example tests makes it clear for everybody what happens, e.g. if the result is freed in the end.

  • It is in the preloaded section, How can do it properly then ?

  • Hi asmgf,


  • I solved this kata today and still got the same issue.

  • if ('12.12.2' <= 90){
    //  alert will not triggered
  • Thx, website looks good!

  • Somewhere you are not wrong... but one could have thought that the framework can handle different types of return.
    Sorry if I gave the impression that you could "Go away":-( It was not the case.
    I modified the tests, thanks for your posts.

  • It's not from the kata but from CW when there is an error in the code. If you have gotten a bad result the info would have been the same as in Python.
    No need to downvote my post. I could do the same to yours...
    BTW Python translation and all others were done by myself.

  • Fixed, sorry but English is not my mother tongue...

  • You get that because of a flaw in your code. Unfortunately the kata can't correct your code:-)

  • Loading more items...