Ad
  • Default User Avatar

    you keep incrementing the str pointer. When you return it, it is pointing to the nul-terminator, so it's effectively an empty string. Also, you overflow the char datatype by adding 13 to the last ASCII letters (e.g. 'z' + 13)

  • Custom User Avatar

    "The one you linked is deciphering it, this one is encoding it, they're not the same."

    ...yes they are?
    eg:

    decode: "ABCD" -> "NOPQ"
    encode: "ABCD" -> "NOPQ"
    

    The encode function is exactly the same as the decode one..

  • Custom User Avatar

    It is already specified how they should be handled in description.

    If there are numbers or special characters included in the string, they should be returned as they are

  • Custom User Avatar

    Anyone reading, feel free to continue discussing, but since this has nothing to do with improving the kata I'm marking this as resolved.

  • Custom User Avatar

    You are not able to nest functions?

  • Default User Avatar

    it's no longer there

  • Custom User Avatar

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

  • Default User Avatar

    You are correct. I just messed the registers up. Have a nice day.

  • Custom User Avatar

    I may be slightly confused, but what does RAX or R9 have to do with malloc call? When you call malloc, the argument is expected to be in RDI register, no? (I haven't solved this in NASM, so I can't check your code)

  • Default User Avatar

    Any idea why malloc does not allocate any memory when running the second set of tests? The allocation works with the visible tests. Even when I clear all code but the memory allocation, I do still receive a null pointer. R9 holds a value. Even when I do mov rax,64 instead it does not change for the second tests.

    Code snippet:
    mov rax,r9
    call malloc

  • Custom User Avatar

    OP solved it, closing

  • Default User Avatar

    how did you guys let the word given remain with the capital letter? I mean if you enter word Test it's supposed to get Grfg not grfg

  • Custom User Avatar

    Missing examples and does not state that outputs must be capitilized.

  • Custom User Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/203.
    Please join the discussion to help us identify duplicate kata and retire them.

  • Default User Avatar

    duplicate of this issue

  • Loading more items...