Beware of big numbers, tail-call optimization is not used here! For more information about Elixir tail-call optimization, read the official docs regarding recursion https://elixir-lang.org/getting-started/recursion.html where (at the moment of writing) is a link to the wikipedia "tail-call" page.
You can add char and int because char is int (partially).
I'm not sure, but I have an insane theory that after mutating the string like you are doing, something really bad happens to it. Try using working with a string as if it was a string (and not a char array (duh)), and I think it may work then.
fetch! i didn't and I see that it was for lack of ";\nsorted"
the compiler said that it was ()
Yeah. It was unfortunately deprecated. Beautiful solution though
Beware of big numbers, tail-call optimization is not used here! For more information about Elixir tail-call optimization, read the official docs regarding recursion https://elixir-lang.org/getting-started/recursion.html where (at the moment of writing) is a link to the wikipedia "tail-call" page.
The useless
int cmd = std::stoi(packet.substr(4,4));
was the problem, when an invalid base 10 command is received, an exception is thrown.
I won't try, but I'm sure all the solutions I'd tried were rigth
Thank you
Seeya
I've just checked it, and according to this SO question starting from
C++ 11
string are immutable objects (as I thougt from the beginning).Trying using
int -> string
conversions and string concatenation instead.I totally agree with your logic, copying your example in its entirity and using the g++ compiler runs and produces the correct result without issue.
This is certainly an issue with how the code is compiled/run in the Kata environment, and not a product of the kata itself.
I will mark this as resolved for now, but please feel free to continue the discussion :)
This comment is hidden because it contains spoiler information about the solution
You can add char and int because char is int (partially).
I'm not sure, but I have an insane theory that after mutating the string like you are doing, something really bad happens to it. Try using working with a string as if it was a string (and not a char array (duh)), and I think it may work then.
This comment is hidden because it contains spoiler information about the solution
Resolved.
Approved, thank you for your contribution!
This is your issue:
out[8] = '0' + result % 10;
You are trying to add together a character and an integer.
Please let me know if your solution works and I will mark this as resolved.
Ps. The way that you are checking for the instruction is clever!
NASM Translation Kumited - please accept :D
This comment is hidden because it contains spoiler information about the solution
Could you share what you have? Mark it with a spoiler flag please thanks!
Loading more items...