Ad
  • Default User Avatar

    Thanks for the clarification.

  • Custom User Avatar

    thanks, fixed!

  • Custom User Avatar

    Sample tests still uses validCheckmate instead of valid_checkmate.

  • Custom User Avatar

    done!

  • Custom User Avatar

    I think I have fixed all of them

  • Custom User Avatar

    Thanks for feedback, working on it!

  • Custom User Avatar

    Thank you for finding this, working on fixing ASAP

  • Custom User Avatar

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

  • Default User Avatar

    I don't understand the results of the following five "Edge cases" as I believe in all cases that the Black King is in checkmate.

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['Q', 'W', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', 'B', '0', '0', '0', '0', '0', '0']

    Black King= [7, 1] White King= [5, 1] White Queen= [5, 0]
    True should equal False

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', 'Q', '0', '0', '0', 'W', '0']

    ['0', '0', '0', '0', 'B', '0', '0', '0']

    Black King= [7, 4] White King= [6, 6] White Queen= [6, 2]
    True should equal False

    ['0', '0', '0', '0', '0', 'B', '0', '0']

    ['0', '0', '0', 'W', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', 'Q', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    Black King= [0, 5] White King= [1, 3] White Queen= [2, 6]
    True should equal False

    ['B', '0', 'W', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', 'Q', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    Black King= [0, 0] White King= [0, 2] White Queen= [2, 1]
    True should equal False

    ['0', '0', '0', '0', 'B', '0', '0', '0']

    ['0', '0', 'W', '0', '0', '0', 'Q', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    ['0', '0', '0', '0', '0', '0', '0', '0']

    Black King= [0, 4] White King= [1, 2] White Queen= [1, 6]
    True should equal False

  • Custom User Avatar

    There seem to be some invalid test cases:

    [
      ['0', '0', '0', '0', '0', '0', '0', '0'],
      ['B', 'Q', '0', '0', '0', '0', '0', '0'],
      ['0', '0', '0', '0', '0', '0', '0', '0'],
      ['0', '0', 'W', '0', '0', '0', '0', '0'],
      ['0', '0', '0', '0', '0', '0', '0', '0'],
      ['0', '0', '0', '0', '0', '0', '0', 'W'],
      ['0', '0', '0', '0', '0', '0', '0', '0'],
      ['0', '0', '0', '0', '0', 'Q', '0', 'B']
    ]
    
  • Default User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    The discription mixes "space" and "whitespace" in an unclear manner.

    Leading and trailing whitespace is also allowed.

    yet

    It should NOT match: "abc\n"

    I suppose it depends on context, but from a regex perspective, I would assume "whitespace" refers to \s. I would just change everything to "spaces" for clarity.

  • Custom User Avatar
  • Custom User Avatar

    not a good practice as we are splitting the string and indexing it at each iteration while it can be done only once

  • Loading more items...