Ad
  • Default User Avatar

    I'm going to tell all my friends that this is what clean code looks like.

  • Default User Avatar
    ['.', 'r', '.', '.', '.', '.', '.', '.']
    ['P', 'p', '.', '.', '.', '.', 'p', '.']
    ['.', '.', '.', '.', '.', '.', '.', '.']
    ['.', '.', '.', '.', 'P', 'p', '.', 'P']
    ['k', '.', 'p', '.', '.', '.', '.', '.']
    ['.', '.', '.', '.', '.', '.', '.', '.']
    ['.', 'P', '.', '.', 'p', '.', 'P', 'P']
    ['.', '.', '.', '.', '.', '.', '.', 'K']
    e5xf6ep white's move
    ['.', 'r', '.', '.', '.', '.', '.', '.']
    ['P', 'p', '.', '.', '.', '.', 'p', '.']
    ['.', '.', '.', '.', '.', 'P', '.', '.']
    ['.', '.', '.', '.', '.', '.', '.', 'P']
    ['k', '.', 'p', '.', '.', '.', '.', '.']
    ['.', '.', '.', '.', '.', '.', '.', '.']
    ['.', 'P', '.', '.', 'p', '.', 'P', 'P']
    ['.', '.', '.', '.', '.', '.', '.', 'K']
    f5-f4 black's move
    ['.', 'r', '.', '.', '.', '.', '.', '.']
    ['P', 'p', '.', '.', '.', '.', 'p', '.']
    ['.', '.', '.', '.', '.', 'P', '.', '.']
    ['.', '.', '.', '.', '.', '.', '.', 'P']
    ['k', '.', 'p', '.', '.', '.', '.', '.']
    ['.', '.', '.', '.', '.', '.', '.', '.']
    ['.', 'P', '.', '.', 'p', '.', 'P', 'P']
    ['.', '.', '.', '.', '.', '.', '.', 'K']
    

    Issue with testing in python. There's no f5 pawn after en-passant so f5-f4 is illegal.

  • Default User Avatar

    Very good choice of variable names, I approve.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Question should specify that the array is a jagged array and not a multidimensional one. It can be inferred from the arguments, but the main reason is to avoid miscommunications in the future for those who aren't aware there is a difference. Obv it's not a kata's job to teach terminology, but it'd be a nice gesture.

  • Default User Avatar

    My code is basically just a method known as lexicographic ordering. Rather than creating all the permutations and then running Distinct, this only does anything if it finds that another permutation is even possible. Basically avoids the issue of running out of ram if you pick a large string.

  • Default User Avatar

    I completely left in an unrelated function... Oops. Also unused import. I was just too excited that I actually pulled it off after 2 hours :D

  • Default User Avatar

    I can't even begin to understand how this solution works, it's beautiful T.T

  • Default User Avatar

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