Ad
  • Custom User Avatar

    Sorry you didn't like my response, sometimes reading the instructions again helps, now that I told you why those numbers can't be in the answer, because I did and only then suggested you read the instructions again. Again, you're not understanding what to do, you're looking at 658 as going from 6 to 8 and from 8 to 5 and you analize that pattern, right? And that's not what you should do, you saw 369, but that number can be 658 amongst others as I already explained. If you don't like my answer, just say "I don't get it", there is no shame in that, and I will try to explain it to you in another way, but please, next time, just be humble and read the instructions again now that you got new information and keep an open mind. After all, it's you who didn't get what to do and I am trying to help you.

  • Custom User Avatar

    Your response would have been more useful if you spent it on explaining the actual kata instead of just believing this was an opportunity for you to make yourself look superior.

    How is "read the instructions again" helpful to anything if I've just posted that they weren't understood the first time?

  • Custom User Avatar

    From 369 you can reach 658 going always horizontally or vertically: from 3 to 6, 6 to 5 and 9 to 8. From 6, you can only reach 2 diagonally and the same happens when you try to go from 9 to 5. So no, 325 isn't valid. You're confused about what you should do, you start with a number, let's say 369, but you're not sure that's the number the robber entered, the 3 could also be a 2 or a 6, but not a 5, etc. Read the instructions again.

  • Custom User Avatar

    closing, as this would be a suggestion anyways, not an issue. there are ways to properly free all of the memory in a standard-compliant way, and without using global variables.

  • Custom User Avatar

    assertion messages for the PHP random tests are completely unhelpful: Failed asserting that false is true

  • Custom User Avatar

    your solution is wrong, for example for observed = "00001", it will return an array like array(48) { "88818", "08818", "80818", "00818", ... } --> the 1 is treated as if it was in the 4th position, while it is in the 5th position in the input. though it is true that assertion messages are horrendous in PHP, i will raise an issue about that.

  • Custom User Avatar

    Yes, returning ACA kills you by your own actions. A proper way to win here is ACBA. I added this to sample tests.

  • Custom User Avatar

    yet another happy customer, what an easy job

  • Custom User Avatar

    Hello. I don't understand this test:

    String: '\t# apples - apples apples\n=\n^'
    Markers: [',', '!', '^', '.', '=', '?', "'", '#', '-']
    '\t\n\n' should equal '\n\n'

    Why do I need to remove the "\t"?

    Ohhhh wait, that counts as whitespace, right? Ah nevermind

  • Custom User Avatar

    the error comes from your code: wrong index calculation, so you access invalid memory

    char *pos = (char*)(pins + (sizeof(char *) * num_pins) + ((cur_idx) * len));
    

    should be:

    char *pos = (char*)pins + sizeof(char *) * num_pins + cur_idx * (len + 1);
    

    (you forgot the + 1 for the nul terminator, and you got the pointer arithmetic wrong: ptr + n will add n * sizeof *ptr to ptr, so you were going out-of-bounds of pins. The cast to char * needs to happen right away, in order to have byte-level memory access.)

  • Custom User Avatar

    I do understand that, but 658 is one of the variations and that has the same pattern as 325. 6 and 8 are adjacent diagonally, but that is a valid solution

  • Custom User Avatar

    it is possible that each of the digits he saw could actually be another adjacent digit (horizontally or vertically, but not diagonally).

    See the keypad again, 3 and 5 are adjacent, but diagonally.

  • Custom User Avatar

    Hello, just trying to understand the variations.
    For this test example: "369": ["339","366","399","658","636","258","268","669","668","266","369","398","256","296","259","368","638","396","238","356","659","639","666","359","336","299","338","696","269","358","656","698","699","298","236","239"], how come 222 and 333 are not variations? Or 555? Or 325? But I see that 666 is there?

  • Custom User Avatar

    Quick question:
    Let's take this one for example: act(2, [[8, 2], [8, 2], [8, 1]]);
    If I get to the last enemy and kill them with A, but using A depletes my health points to zero, did I win or lose?

  • Custom User Avatar

    done

  • Loading more items...