Ad
  • Default User Avatar

    Ahh! You were correct! I was not removing the Black Pegs first, allowing for false White Peg values.

    Thanks for pointing that out to me!

  • Default User Avatar

    I'm having some difficulty troubleshooting my code. All the test pass, but when I do the Attempt, I get some that are incorrect. I've been tweeking this for a while now and can't figure out where my logic is wrong. My code is working as written, just not getting the correct outcome. See below example of what is perplexing me.

    If I understand correctly, the logic is as follows:

    • If a Color is a match AND in the same position = it should be BLACK.
    • If a color is a match but NOT in the same location = it should be white with a caviat
      • Caviat: the match has not already been "used" (e.g. already black or already matched as white)

    One of the scenario is:
    Answer set: [1,1,1,2,2,2,1,1,1,2,2,2,3,3,3]
    Guess set: [1,1,1,1,1,1,2,1,1,1,1,2,3,1,1]
    My Result: [B,B,B,W,W,W,W,X,X,X,X,B,B,X,X] {B: 5, W: 4}
    Kata Correct result {B:5, W: 2}

    Similary, another scenario is:
    Answer set: [1,1,1,2,2,2,1,1,1,2,2,2,3,3,3]
    Guess set: [3,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
    My Result: [W,B,B,W,W,W,B,B,B,X,X,X,X,X,X] {B: 5, W: 4}
    Kata Correct result: {B: 5, W: 2}

    If anyone knows what I am missing about the rules for W assignment, the help would be greatly appreciated!

    Thanks!

  • Default User Avatar

    Yes, this does seem to be my issue. I was missing that scenario in my code. Working now to correct.

    Thanks Guaz!

  • Default User Avatar

    I have done the logical troubleshooting. And yes, maybe it is my code and not an issue of the Kata. But, as the link suggested, I have ran them manually, checked the input cases that are failing (was well as some that are passing), and ran two successive calls with different inputs. So, again, maybe I'm missing something. Sorry to bother anyone by misclassifying this as an issue.

  • Default User Avatar

    I feel like I'm missing something. I have ran this multiple times with slight variations and seem to be missing the same test cases. I have manually checked the test cases that I can, and my logic/code should be producing the correct outcome, but for some reason it is not. More than happy to share my code.

    Failing the last 3 connected graphs/tests: Saying they should be True but I am getting False. I would think that the connected ones should be False.