Ad
  • Custom User Avatar

    Issue with the PHP tests:

    These incorrectly replace multiple consecutive input or output characters (, & .) with just a single putchar / getchar call.

    This is incorrect, as while reading multiple bytes from input would only store the last, it would still consume multiple bytes.

    Same goes for the output: the written character would be the same each time, but it would still be written twice.

    (The interpreter in the tests would print Helo, World!, with just a single 'l', for example).

    I could get my solution to pass by implementing the same error, but that is obviously not right.

    Edit: Just noticed hotdonkey already reported this 9 months ago...

  • Custom User Avatar

    For the C translation, the tests expect us to return a newly-allocated character string, but never frees it. I know it doesn't free it now because the initial solution returns a statically allocated string instead and doesn't break the allocator.
    A change to the function's interface or the initial solution would allow the tests to free the returned string instead of wasting that memory.

  • Default User Avatar

    The tip for C: more memory,very more

  • Default User Avatar

    ummmmm Expected: equal to "*p += 4;
    "
    Actual: "*p += 4;"

  • Default User Avatar

    In description it is told that repeated "." and "," commands must act like repeated commands

    1. . command must be replaced by putchar(*p);\n.
      Example:
      ".." -> "putchar(*p);\nputchar(*p);\n"

    However to pass random tests i had to combine them to one.
    "...." -> "putchar(*p);\n"
    So there is either missleading description or tests.

  • Custom User Avatar

    What difference does it make if my algorithm, as a result of calculations, replaced this sequence "+<->" with a similar one "<->+" ? Or this "<<--<-<+>--+" (8 lines in C) to the optimized "<<--<--<+>" (7 lines in C) ?
    Why is kata hardcoded to one C variant, not realizing that other variant (smaller or equal in number of lines) can lead to the same calculation results? O_o

  • Custom User Avatar

    Can't stop getting timeouts for the c++ version.

    I'm 99% sure it's not my fault because even when I immediately return std::string() from the function, I still timeout even though my function is doing absolutely no calculation. All the other tests pass perfectly fine and on my machine at home a 10k brainfuck source code computes in like 30 milliseconds

    Simply returning an empty string immediately still times me out.

  • Custom User Avatar

    Shall I suggest that this kata expected result is 'suboptimal' ??
    My attempt passes the fixed tests, but the for some random test the expected contains
    "... *p += 2; *p -= 1;..."
    where my solution gives "..*p+=1;..." for those same both lines ??

  • Custom User Avatar

    C++ version should probably accept source_code parameter as const std::string& instead of std::string

  • Custom User Avatar

    I'm having an issue in the last performance test. It says "The translation was failed. - Expected: true, instead got: false" and the input it's "[[>?-+<]]..." repeated many times. What would be the expected output in this case? My solution is outputting the following:

    if (*p) do {
      if (*p) do {
        p += 1;
        *p -= 1;
        *p += 1;
        p -= 1;
      } while (*p);
    } while (*p);
    ...
    

    Not sure what I'm missing here.

  • Custom User Avatar

    Random tests in JavaScript are problematic because the user does not get to see the expected answer, meaning even if we log the input and process it line by line, we cannot see what the checker expects. In some cases it is clear the checker is rejecting a demonstrably correct solution.

    That being said, nice kata. To the people saying it requires too much performance for a level 4 kata, I wouldn't agree, you should just try various methods of parsing until you find the most efficient one possible.

  • Default User Avatar

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

  • Default User Avatar

    Kotlin translation, would someone mind reviewing this please.

  • Custom User Avatar

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

  • Custom User Avatar

    The python version trims the expected output so much that it's impossible to debug.

  • Loading more items...