Ad
  • Default User Avatar

    I do. Do you want to try to find it first? If not I'll tell you now...

  • Custom User Avatar

    Don't forget the spoiler flag, please.

  • Custom User Avatar

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

  • Default User Avatar

    Few people are refactoring; Good Job

  • Default User Avatar

    Isn't programing for speed (O(n) time vs O(n Squared) time) a best practice???

  • Default User Avatar

    Your solution has a potential crash bug in it; the same one that mine has.
    Do you see it? (The Kata Test can't catch it that's why ours passed)

  • Default User Avatar

    No falut in the Kata; it could not have caught it...

  • Default User Avatar

    My "solution" has a severe bug, do you see it?

  • Default User Avatar

    Assume! That sounds reall good.

    I'm very impressed with your turn around time and dedication!

  • Default User Avatar

    This translation was done when I had just started translating to C. I can't recall if C18 was available then or only 3.6. When I became aware of C18 I began translating with that as my standard. So, seeing what's up with this kata suggests I go check out my other old translations as I have with this one. Today I gave this translation the royal treatment: by adding the NULL check you mentioned, providing better feedback for failed code, and (of course) eliminating all of those 32 warnings.

  • Default User Avatar

    Minor issue since as you pointed out you can still do the Kata...

  • Default User Avatar

    If you look at the test code:

    #define ASSERT_ARR_EQ(expected, submitted, sz)
    if(sz == 0 && submitted != NULL)
    { free(submitted); submitted = NULL;
    cr_assert(0, "n == 0, should return NULL\n"); }
    for(size_t i=0; i<sz; i++)
    if(submitted[i] != expected[i])
    cr_assert(0,
    "Incorrect value at index %i: %lld should equal %lld\n",
    i, submitted[i], expected[i]);
    cr_assert(1);

    It does not NULL check submitted if sz != 0...

  • Default User Avatar

    Actually when I simply return NULL there does appear to be a testing error:

    Test Results:
    Sample_Tests
    should_pass_all_the_tests_provided
    Test Crashed
    Caught unexpected signal: SIGSEGV (11). Invalid memory access.

    Should the Test crash?

    NULL is supposed to mean 'empty array' in this test.
    Shouldn't it be reported as a wrong return value as opposed to the test crashing?

  • Default User Avatar

    Ah yes, Correct.

    I guess my mind set is warings == errors

    I don't let warnings stand because they either contain important info or obscure other important info when out of hand...

  • Custom User Avatar

    You mean compilation warnings ?
    Other than a shitton of warnings, kata works fine in C.

  • Loading more items...