Ad
  • Custom User Avatar

    Not.

    There is one way to do nothing.

  • Custom User Avatar

    The author is not responding. Closing.

  • Custom User Avatar

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

  • Custom User Avatar

    Except that's not at all what I asked to you... (well, I wasn't clear enough)

    you should print the output on CW, not on your ide. Ofc you get false when doing it on your idea, we already knew that. The interesitng part is that, when I tweak just a bit your code so that it prints the output on CW, here is what I get:

     1 3 2 5 7 9 4 6 8
    Log
    4 9 8 2 6 1 3 7 5
    7 5 6 3 8 4 2 1 9
    6 4 3 1 5 8 7 9 2
    5 2 1 7 9 3 8 4 6
    9 8 7 4 2 6 5 3 1
    2 1 4 9 3 5 6 8 7
    3 6 5 8 1 7 9 2 4
    8 7 9 6 4 2 1 3 5 should be invalid
    
    true      <<< This is printed from the guts of your code, just before the very last line of the function
    
    Test Failed
    true was not false
    

    So there is definitely a problem, but seems to me it's definitely not in the kata itself.

  • Custom User Avatar

    errrr...

    Test Failed
    true was not false
    
    like: "actual was not expected"?
    

    seems to me that your code is telling true, here, and that it's not was is expected.
    Print your output to the console to be sure, but imo, the problem is in your code.

  • Custom User Avatar

    the real question is: is your code still returning false on that specific test on cw? If not, are you sure you're not reading the input of one test with the output of another or vice versa, or are you mutating something (I don't do scala)?

    "put in an easier way": paste here the complete message you get on cw.

  • Custom User Avatar

    val invalidBoard=...

    See the "invalid", in there? Meaning the expected answer is false. So if the assertion fails, that means that your code isn't returning false.

    corolary:

    • either you read the logs the wrong way
    • or expected and actual are swapped. => need to know about the language your're using.
  • Default User Avatar

    The parentheses are nested.