• Custom User Avatar

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

  • Custom User Avatar

    Fixed the precision of printed values.

  • Custom User Avatar

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

  • Custom User Avatar

    Those informations are better in solution set up.

  • Custom User Avatar

    @avighna the solution setup had already had extern malloc
    The function declaration in comment char *play_pass(const char *phr, int shf) prompts that phr is const and should not be modified!
    Anyway thanks for adding the comments in description!
    But now your fork can only be approved by the author or admins.

  • Custom User Avatar

    @g964
    The fork is ok!
    've thought that it is clear from the function header to allocate memory yourself...

  • Custom User Avatar

    Exact floating-point equality is completely fine in this kata. Floating-point computations are not random. All rules are specified in the description (make sure that everything is evaluated from left to right and use the most precise conversion from strings to numbers).

  • Custom User Avatar

    I was just blindly going by the System V ABI calling convention ( here under 'System V' https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI )

  • Custom User Avatar

    @hobosky: could you see and approve the Nasm fork?

  • Custom User Avatar

    I am not the Nasm translator and know nothing to Nasm. Maybe you could add a small note for Nasm but ask Hobosky (who is a big chief here) for what you can add. I know nothing of that translation but seeing other's solutions it seems usual to use "malloc" and add "extern malloc"...

  • Custom User Avatar

    This probably means that your solution does not handle memory allocation of resulting buffer correctly.

    Which is kinda difficult to do, because requirements for memory allocation are not specified at all.

  • Custom User Avatar

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

  • Custom User Avatar

    After 6 hours making diagram on miror my brain just stopped.
    I well end later

  • Custom User Avatar

    count_if seems that it should actually be slower than a simple for loop, unless it inlines the passed function.
    Even then, it can't be faster than a simple for loop, and usually for loop is easier to read.

    So what makes "count_if" better than a simple for loop?

  • Custom User Avatar

    It is best practice because instead of implementing your own counting function, you use the standard library one count_if. I do agreed it is hard to read if you have no idea what you are looking at; perhaps comments would've made this easier to understand

  • Loading more items...