Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Anyone able to check out my code? I keep getting stuck on on advanced test 3440 of 4200. The timing quits after ~5 seconds. This is in C.

  • Custom User Avatar

    I just want to make sure I'm understanding what is getting read, what is getting written, and to/from where.

    1. I have the binary version of the input in little endian (by bit).
    2. I have a "tape" that acts like working memory. The pointer that the commands "<" and ">" reference this working memory pointer.
    3. I have the output stream.
    4. "," takes the next bit from the binary version of the input and places it wherever the tape pointer is located.
    5. ";" takes the bit pointed by the tape pointer and places it in the output stream/buffer.
    6. Everything else is moving/manipulating the bits on the tape

    Am I understanding this correctly? Thank you!

  • Custom User Avatar

    Language C:

    Looking for some hints for the actual test cases. I'm able to pass all example cases and one of the random ones. However, I keep getting stuck with a SEGFAULT Invalid Memory Access. Obviously I cannot print out the test case during a SEGFAULT, but I'm trying to think of edge cases where my program could SEFAULT. I can't think of weird inputs that would cause an invalid memory access. Are there any "gotcha's" in the submission cases that I'm missing?

  • Custom User Avatar

    Well my solution was quite.... verbose lol. smacks forehard

  • Custom User Avatar

    Figured it out. For others who may run into this issue in Java, I was throwing the noSuchElement exception which was interrupting before the expected "return false". Don't throw the exception like it says in the description, just have the hasNext() method return false.

  • Custom User Avatar

    Java question: I'm a little confused on what to do with an empty string or null... I'm throwing a NoSuchElementException() in the case that it isn't a valid string but it is saying that I'm still failing the test.

  • Custom User Avatar

    How would hell return java over ruby? Both required 4 changes. 1 replacement for each letter in hell. From ruby: huby, heby, hely, hell. From java: hava, heva, hela, hell.

  • Custom User Avatar

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

  • Custom User Avatar

    Ah that makes sense and fixes the issue. Completed.

    I was reading it as the constant being a different way to reference the same area of memory instead of calling it 'a' register.

  • Custom User Avatar

    For C:
    Expected:
    {'a' = 1, 'b' = 0, 'c' = 0, 'd' = 1, 'e' = 0, 'f' = 0, 'g' = 0, 'h' = 0, 'i' = 0, 'j' = 0, 'k' = 0, 'l' = 0, 'm' = 0, 'n' = 0, 'o' = 0, 'p' = 0, 'q' = 0, 'r' = 0, 's' = 0, 't' = 0, 'u' = 0, 'v' = 0, 'w' = 0, 'x' = 0, 'y' = 0, 'z' = 0}

    but got:
    {'a' = 1, 'b' = 0, 'c' = 1, 'd' = 1, 'e' = 0, 'f' = 0, 'g' = 0, 'h' = 0, 'i' = 0, 'j' = 0, 'k' = 0, 'l' = 0, 'm' = 0, 'n' = 0, 'o' = 0, 'p' = 0, 'q' = 0, 'r' = 0, 's' = 0, 't' = 0, 'u' = 0, 'v' = 0, 'w' = 0, 'x' = 0, 'y' = 0, 'z' = 0}

    ==============

    program:

    ==============

    mov d 100

    dec d

    mov b d

    jnz b -2

    inc d

    mov a d

    jnz 5 10

    mov c a

    I'm confused how register C should be 0. Moving through the program I see:

    mov d 100,
    dec d,
    mov b d,
    jnz b -1

    This loop decrements d by 1 starting with 100 and copies it into b. This happens until b is 0. Then...

    d register is incremented to 1.
    d register value (1) is moved to a so a register is now 1.
    jnz 5 10 does nothing because register number 5 is zero so it continues to the next command.
    mov c a moves the value a (which is 1 at this point) into c register. So how is c register expected to be 0?

  • Custom User Avatar

    I'm using List result = new ArrayList() and I'm still getting a fail. Not sure exactly what type they're asking for because at face value it is the exact same strings.

  • Custom User Avatar

    Wouldn't that be over-counting the cell's neighbors? The top left cell would be the bottom of the cell that is already being counted as the cell to the left... it's the same cell just a different side of it. And wouldn't the due north cell and the due south cell be counting itself as live neighbors?

  • Custom User Avatar

    I'm a little confused on the single row/single column universes and how each cell's neighbor his counted. The way I visualize it is that if the universe is "0 1 0 1 0 1 0 1 1" for example... each column would fold on its self (so the bottom of the a cell would be touching it's own top) and only the first and last cells' sides would be touching. So it would almost be like a flat donut shape. So in this case.... wouldn't all cells die per the rules? Each dead cell only has 2 live neighbors (3 required) and each live cell (except for the last cell) has no live neighbors which means they die off.

  • Custom User Avatar

    In C, for the test cases it says that the function tester isn't defined or prototyped. Looking through the test code I don't see any prototype for th tester function. Is it missing a library to pull tester from?

  • Loading more items...