Ad
  • Custom User Avatar
  • Custom User Avatar

    needs restricted ( or similar ) tag

  • Custom User Avatar

    ( Python )

    without the or keyword

    This is not tested

  • Custom User Avatar

    ( Python, possibly others )

    Random tests generate out of bounds cases. Description promises us max 6 elements. It doesn't matter for the logic of course, but specs are specs.

  • Default User Avatar

    Thanks for creating this kata! Very impressive testing.

    Suggestion: Change "he" to "they" in the description. Not only males play Reversi (Othello).

    It would be fun if the performance of the user's code compared with the reference implementation was displayed.

  • Custom User Avatar

    (JS, possibly others)

    Description could be improved:

    • "return null if the array is empty"
    • "each implies the next" is incorrect; that would return a length n-1 array of Booleans. it's more of a rolling result; each prefix result implies the next value, recursively.

    The empty array case is completely arbitrary ( returning True would actually make more sense ); also, [False] by itself should also really return True IMO. Why are lengths < 2 even tested? Just don't.

    Maximising array length at 8 is also arbitrary. You're not going to hardcode this, are you? ( Actually, the tests are hardcoded. I would definitely have done that algorithmically! O.O ) But there will always be some limit, and 8 is as good as any.

  • Custom User Avatar

    Do test cases cover the following situations? If not there should. (A and B represent PlayerA and PlayerB)

    • A has some valid empty spaces to move but choose to move on another invalid empty space
    • A has no valid empty spaces to move so it's B's turn, while B has some valid spaces but choose to move on an invalid one
    • Moves after the board is filled
    • Moved after A and B both have no valid spaces to move
  • Custom User Avatar

    For test ['f5f4f3g4e3e6g3d3c4c5c3b4d6d2g6f6e7e2f2h3b6g5f7c6h5d7h4e8h2a6c8g7g2h6d8h1h8h7e1g1f1d1c7b7a8b8c1c2b5a5g8f8b2b1a4a2a1b3a3a7', ['C',None,'B',38,26]]
    According to my calculation, the last a7 is a invalid move because the board is

    .12345678
    ABBBBWW.B
    BWWBBWWWW
    CWWBWBBWW
    DWBBBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    

    Did i miss anything?

    Step by step move

    f 5 B
    .12345678
    A........
    B........
    C........
    D...WB...
    E...BB...
    F....B...
    G........
    H........
    f 4 W
    .12345678
    A........
    B........
    C........
    D...WB...
    E...WB...
    F...WB...
    G........
    H........
    f 3 B
    .12345678
    A........
    B........
    C........
    D...WB...
    E...BB...
    F..BBB...
    G........
    H........
    g 4 W
    .12345678
    A........
    B........
    C........
    D...WB...
    E...WB...
    F..BWB...
    G...W....
    H........
    e 3 B
    .12345678
    A........
    B........
    C........
    D...WB...
    E..BBB...
    F..BWB...
    G...W....
    H........
    e 6 W
    .12345678
    A........
    B........
    C........
    D...WB...
    E..BBBW..
    F..BWW...
    G...W....
    H........
    g 3 B
    .12345678
    A........
    B........
    C........
    D...WB...
    E..BBBW..
    F..BBW...
    G..BW....
    H........
    d 3 W
    .12345678
    A........
    B........
    C........
    D..WWB...
    E..BWBW..
    F..BBW...
    G..BW....
    H........
    c 4 B
    .12345678
    A........
    B........
    C...B....
    D..WBB...
    E..BBBW..
    F..BBW...
    G..BW....
    H........
    c 5 W
    .12345678
    A........
    B........
    C...BW...
    D..WBW...
    E..BBWW..
    F..BBW...
    G..BW....
    H........
    c 3 B
    .12345678
    A........
    B........
    C..BBW...
    D..BBW...
    E..BBWW..
    F..BBW...
    G..BW....
    H........
    b 4 W
    .12345678
    A........
    B...W....
    C..BWW...
    D..BWW...
    E..BWWW..
    F..BWW...
    G..BW....
    H........
    d 6 B
    .12345678
    A........
    B...W....
    C..BWW...
    D..BBBB..
    E..BWBW..
    F..BBW...
    G..BW....
    H........
    d 2 W
    .12345678
    A........
    B...W....
    C..WWW...
    D.WBBBB..
    E..BWBW..
    F..BBW...
    G..BW....
    H........
    g 6 B
    .12345678
    A........
    B...W....
    C..WWW...
    D.WBBBB..
    E..BBBW..
    F..BBB...
    G..BW.B..
    H........
    f 6 W
    .12345678
    A........
    B...W....
    C..WWW...
    D.WBWBB..
    E..BBWW..
    F..BBBW..
    G..BW.B..
    H........
    e 7 B
    .12345678
    A........
    B...W....
    C..WWW...
    D.WBWBB..
    E..BBBBB.
    F..BBBW..
    G..BW.B..
    H........
    e 2 W
    .12345678
    A........
    B...W....
    C..WWW...
    D.WWWBB..
    E.WBBBBB.
    F..WBBW..
    G..BW.B..
    H........
    f 2 B
    .12345678
    A........
    B...W....
    C..WWW...
    D.WWWBB..
    E.WBBBBB.
    F.BBBBW..
    G..BW.B..
    H........
    h 3 W
    .12345678
    A........
    B...W....
    C..WWW...
    D.WWWBB..
    E.WWBBBB.
    F.BWBBW..
    G..WW.B..
    H..W.....
    b 6 B
    .12345678
    A........
    B...W.B..
    C..WWB...
    D.WWBBB..
    E.WBBBBB.
    F.BWBBW..
    G..WW.B..
    H..W.....
    g 5 W
    .12345678
    A........
    B...W.B..
    C..WWB...
    D.WWBBB..
    E.WWBBBB.
    F.BWWBW..
    G..WWWB..
    H..W.....
    f 7 B
    .12345678
    A........
    B...W.B..
    C..WWB...
    D.WWBBB..
    E.WWBBBB.
    F.BWWBBB.
    G..WWWB..
    H..W.....
    c 6 W
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWB..
    E.WWWBBB.
    F.BWWBBB.
    G..WWWB..
    H..W.....
    h 5 B
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWB..
    E.WWWBBB.
    F.BWWBBB.
    G..WWBB..
    H..W.B...
    d 7 W
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWWW.
    E.WWWBWB.
    F.BWWWBB.
    G..WWBB..
    H..W.B...
    h 4 B
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWWW.
    E.WWBBWB.
    F.BWBWBB.
    G..BBBB..
    H..WBB...
    e 8 W
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWWW.
    E.WWBBWWW
    F.BWBWBB.
    G..BBBB..
    H..WBB...
    h 2 B
    .12345678
    A........
    B...W.B..
    C..WWWW..
    D.WWBWWW.
    E.WWBBWWW
    F.BWBWBB.
    G..BBBB..
    H.BBBB...
    a 6 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW..
    D.WWBWWW.
    E.WWBBWWW
    F.BWBWBB.
    G..BBBB..
    H.BBBB...
    c 8 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWBWWB.
    E.WWBBBWW
    F.BWBBBB.
    G..BBBB..
    H.BBBB...
    g 7 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWB.
    E.WWBWBWW
    F.BWBBWW.
    G..BBBBW.
    H.BBBB...
    g 2 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWB.
    E.WWBWBWW
    F.BBBBWW.
    G.BBBBBW.
    H.BBBB...
    h 6 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWB.
    E.WWBWBWW
    F.BBWBWW.
    G.BBBWWW.
    H.BBBBW..
    d 8 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    E.WWBWBBW
    F.BBWBBW.
    G.BBBBWW.
    H.BBBBW..
    h 1 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    E.WWWWBBW
    F.BWWBBW.
    G.WBBBWW.
    HWWWWWW..
    h 8 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    E.WWWWBBW
    F.BWWBBW.
    G.WBBBWB.
    HWWWWWW.B
    h 7 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    E.WWWWBBW
    F.BWWBBW.
    G.WBBBWW.
    HWWWWWWWB
    e 1 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    EBBBBBBBW
    F.BWWBBW.
    G.WBBBWW.
    HWWWWWWWB
    g 1 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    EBBWBBBBW
    F.WWWBBW.
    GWWBBBWW.
    HWWWWWWWB
    f 1 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    D.WWWWWBB
    EBBWBBBBW
    FBBBBBBW.
    GWWBBBWW.
    HWWWWWWWB
    d 1 W
    .12345678
    A.....W..
    B...W.W..
    C..WWWW.B
    DWWWWWWBB
    EWWWBBBBW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    c 7 B
    .12345678
    A.....W..
    B...W.W..
    C..WWWWBB
    DWWWWWBBB
    EWWWBBBBW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    b 7 W
    .12345678
    A.....W..
    B...W.WW.
    C..WWWWWB
    DWWWWWBWB
    EWWWBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    a 8 B
    .12345678
    A.....W.B
    B...W.WB.
    C..WWWBWB
    DWWWWBBWB
    EWWWBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    b 8 W
    .12345678
    A.....W.B
    B...W.WWW
    C..WWWBWW
    DWWWWBBWW
    EWWWBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    c 1 B
    .12345678
    A.....W.B
    B...W.WWW
    CB.WWWBWW
    DWBWWBBWW
    EWWBBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    c 2 W
    .12345678
    A.....W.B
    B...W.WWW
    CBWWWWBWW
    DWWWWBBWW
    EWWBBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    b 5 B
    .12345678
    A.....W.B
    B...WBWWW
    CBWWWBBWW
    DWWWWBBWW
    EWWBBBBWW
    FWBWBBBW.
    GWWBWBWW.
    HWWWWWWWB
    a 5 W
    .12345678
    A....WW.B
    B...WWWWW
    CBWWWWBWW
    DWWWWWBWW
    EWWBBWBWW
    FWBWBWBW.
    GWWBWWWW.
    HWWWWWWWB
    g 8 B
    .12345678
    A....WW.B
    B...WWWWW
    CBWWWWBWW
    DWWWWWBWW
    EWWBBWBWW
    FWBWBWBB.
    GWWBBBBBB
    HWWWWWWWB
    f 8 W
    .12345678
    A....WW.B
    B...WWWWW
    CBWWWWBWW
    DWWWWWBWW
    EWWBBWBWW
    FWBWBWWWW
    GWWBBBBWB
    HWWWWWWWB
    b 2 B
    .12345678
    A....WW.B
    B.B.WWWWW
    CBBBWWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    b 1 W
    .12345678
    A....WW.B
    BWB.WWWWW
    CWWBWWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    a 4 B
    .12345678
    A...BWW.B
    BWB.BBWWW
    CWWBBWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    a 2 W
    .12345678
    A.W.BWW.B
    BWW.BBWWW
    CWWBBWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    a 1 B
    .12345678
    ABW.BWW.B
    BWB.BBWWW
    CWWBBWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    b 3 W
    .12345678
    ABW.BWW.B
    BWWWWWWWW
    CWWWWWBWW
    DWBWBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    a 3 B
    .12345678
    ABBBBWW.B
    BWWBBWWWW
    CWWBWBBWW
    DWBBBWBWW
    EWBBBBBWW
    FWBWBWBWW
    GWWBBBBBB
    HWWWWWWWB
    
    
  • Custom User Avatar

    Some questions need to be clarified:

    • Is the chessboard size always be 8 x 8?

    • What's the state of Complete? Only one kind(black or white) one the board?

    • What's the state of Error? movelist contains invalid move(such as f9, f0, z1..)? or duplicate movements?

    • What's the mean of 'f5f4f3g4e3e6g3d3c4c5c3b4d6d2g6f6e7e2f2h3b6g5f7c6h5d7h4e8h2a6c8g7g2h6d8h1h8h7e1g1f1d1c7b7a8b8c1c2b5a5g8f8b2b1a4a2a1b3a3a7'
      (I can guess what this is, but you should tell us in the description)