Ad
  • Custom User Avatar

    I have the same issue. How did U solve this?

  • Custom User Avatar

    My func modifies the board and this seems to persist across tests. That's pretty annoying

    It should be passing all the simple tests as it is but it's failing.

  • Custom User Avatar

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

  • Custom User Avatar

    Where is the KYLAN post? Or any post describing the problem?

  • Custom User Avatar

    Thanks. Still don't get it.

  • Custom User Avatar

    I don't get it. More explantion needed

  • Custom User Avatar

    I just want help understanding the problem without any code invloved. I've tried various ways to show the blocks here so I can demo my misunderstanding, but they don't format correctly :(.

    For flip('R', [3, 2, 1, 2]), shifting the blocks right (not in code, just in theory), I get [1, 3, 4], which is wrong. Any one explain where [1, 2, 2, 3] comes from?

  • Custom User Avatar

    Did U get a grasp on the problem? I'm having this issue also.

  • Custom User Avatar

    I had a logic error.

  • Custom User Avatar
  • Custom User Avatar

    In C++ how do I return (not print) true of false? I get back 1 when I do return true. This fails the tests. (More of a C++ question than a kata issue)

  • Custom User Avatar

    Thanks alot everyone. I solved it. This was by far the hardest, easy challenge I've done here. The code is very simple but it took all your help and hours to really figure out what the problem was.

    I think it could be better worded, but isn't that the case with all katas pretty much.

    Awesome kata. Thanks again.

  • Custom User Avatar

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

  • Custom User Avatar

    Alright. Last comment and if I don't get it I'll move on. I'm not sure if this right.

    In the example using ,+[-.,+] and Codewars. I have a tape, tape = [].
    Using the , I accept in C to tape. Now tape = [67]. I + add one, - subtract one, then I use . to get the value at the data-pointer, which points to tape or tape[0] since that is the only value. I'll push that to an outside list that holds the final output. str = [] then str.append(tape[0).

    Next I accept antoher value at , to tape, now tape = [67, 111]. BUT now I add and subtract what? The data-pointer is still pointed at tape[0]. There are no > here, so all that happens here is C keeps getting added. This can't be right but it's what I've gathered from our discussion.

  • Custom User Avatar

    In this case there are only three places this cursor can be active, I think. @FArekkusu - Memory has to be somewhere though? I'm not doing this is C so I'm not mallocing.
    One of these is what the cursor moves on:

    1. The code string - while not proper computer science terminology, I mean the argument param with the name code in Python. This is the Brainfuck code. i.e. ,+[-.,+]
    2. The argument param named input in Python. This is the string that I was moving the cursor on but was failing. i.e Codewars.
    3. The output array/string. This is place that the . puts the final bytes. Also maybe referred to as memory. I think. i.e. the return values Codewars

    There is no memory unless it's one of these? Or am I missing something? So I'm guessing that #3 is where I move. If this is the case then my second questions will not be an issue. I was moving the cursor along the wrong piece of data, input. It doesn't say which it should move along in the description; data could be anything IMHO.

    Thanks @Blind4Basics for your clariifcation!

  • Loading more items...