Ad
  • Default User Avatar

    Every prime number except 2 and 3 is of the form 6k+1 or 6k-1 , this property can be used to avoid unnecessary looping:)

  • Custom User Avatar

    @Hadron, that is a good summary of the problem. Can you suggest a more helpful wording for the error message?

  • Custom User Avatar

    This looks like a case of the instructions not being followed to the letter.

    'If one or more of the opponents pieces are sandwiched by the piece just played and another of the current player's colour...'

    Emphasis on 'just played'.

    In the play sequence that both MariusAFT and jkranking refer to, neither of the adjacent pieces are 'just played'.

    Instead, white has cleverly inserted his piece between two of his opponents previously played pieces, rendering his piece safe.

    It caught me out too. If I'm right about the reason then this specific error message might need revising as it's misleading.
    Good kata, however.

  • Custom User Avatar

    Hi @hovacink. I've just checked the test in the four languages and are working well. Python may experiment being timed out once in ten attempts. For the other versions the runtime is under 3500 ms. Hope that you can solve it.

  • Custom User Avatar

    same problem here ;/ only the first 2 tests get executed

  • Custom User Avatar

    Note that the flipping stops when the first piece of the player's colour is reached.

    Does that help?

    Could you explain the algorithm you are using?

  • Default User Avatar

    I'm getting the same error. Non-adjacent piece should NOT flip - Expected: ".O.O*.", instead got: ".O.****."

    Is this correct? I don't understand why the answer is not ".O.****" instead of ".O.O*"

    The instructions say that move should flip anytime it is sandwiched by another move.

    Thanks

  • Default User Avatar
  • Custom User Avatar

    Consider what happens to your code if you get an empty list.

  • Default User Avatar

    Hello,
    My code passes the first 8 tests, after which I get IndexError: list index out of range.
    In my IDE I get no errors, no warnings.
    I am using Python 3.
    Can anybody help me figure what is wrong?
    Thanks!

  • Custom User Avatar

    * is a special markdown character that causes italics or bold so you to surround it with backticks.
    '.O.****.' should equal '.O.*O**.'

    What does the board look like before you place the piece at index 6?

  • Default User Avatar

    on my screen, index 3 and index 5 are *. I don't know why it displayed like that when I copy-pasted the error.

  • Custom User Avatar

    Could you explain why it makes sense to flip the O at index 4?

  • Default User Avatar

    Hello,
    I made a small program for this Kata. When tested, I pass the first 16 tests, and then I get this error: Non-adjacent piece should NOT flip: '.O.****.' should equal '.O.O*.'

    But, for me it makes sense to flip O to * on index 4. Can anybody explain?
    Thanks,
    Marius

  • Custom User Avatar

    Due to some changes on the servers, the javascript version is having problems now. Seven people passed before without problems. I checked the python and ruby version and are working fine.

    Let's see if I can make some changes to speed it up.

  • Loading more items...