Ad
  • Custom User Avatar

    I've fixed it (hopefully as what you intended to see), a lot of kata also uses this code (likely copied from some templates), so perhaps you can raise an issue everytime you've encountered them

  • Custom User Avatar

    Fixed though it is not really an issue :-)

  • Default User Avatar

    besides the superfluous trailing semicolon, what's wrong with this setup ? the author should be free to put the strict mode directive there if they so wish, in my opinion. if you don't like it, you can easily delete it

  • Custom User Avatar

    Because it's the most missing feature of the language :D

  • Default User Avatar

    It's just the first thing that came to mind. I plan more interesting things later

  • Default User Avatar

    Solved both

  • Custom User Avatar

    Please note that it's futile to fix a kata that has been retired.

  • Default User Avatar

    Sorry about that. I just fixed that.

    You should be able to see in the description now that Whisker can in fact get two consecutive life orbs and get back to 1 life.

    This example should be dead:

    check_cat_life(['Curse', 'Challenge', 'Life Orb', 'Life Orb'], 1) -> 'Dead'
    

    This example should be alive:

    check_cat_life(['Curse', 'Life Orb', 'Life Orb'], 1) -> 'Alive'
    

    For this example:

    check_cat_life(['Curse', 'Healing Potion', 'Life Orb'], 1)
    

    It should be dead because the healing potion shouldn't have any effect. It won't increase the lives by 2, it won't resurrect. Only the life orb can resurrect, but since the life orb isn't used as soon as Whisker gets to -1 lives, Whisker is dead.

  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    Approved.

  • Custom User Avatar

    It normally shouldn't. I assume that tests are weak, but I also don't understand the need for validating input. xD

  • Default User Avatar
  • Default User Avatar

    done

  • Default User Avatar
  • Default User Avatar

    thank you very much for the notice. I have made a change to the RTG, albeit somewhat clumsy, it works:

            ull a_b_c_d[4] = { 0 };
            while(
                a_b_c_d[0] == a_b_c_d[1] ||
                a_b_c_d[0] == a_b_c_d[2] ||
                a_b_c_d[0] == a_b_c_d[3] ||
                a_b_c_d[1] == a_b_c_d[2] ||
                a_b_c_d[1] == a_b_c_d[3] ||
                a_b_c_d[2] == a_b_c_d[3]  
            ) {
                a_b_c_d[0] = rand() % 101 + 1;
                a_b_c_d[1] = rand() % 101 + 1;
                a_b_c_d[2] = rand() % 101 + 1;
                a_b_c_d[3] = rand() % 101 + 1;
            }
            qsort(a_b_c_d, EIGHT / 2, sizeof(ull), comp_ull);
            ull a = a_b_c_d[0],
                b = a_b_c_d[1],
                c = a_b_c_d[2],
                d = a_b_c_d[3];
    
  • Loading more items...