Ad
  • Default User Avatar
    A	B	C	D	E	F	G	H
    

    8 ♛ ♚
    7
    6
    5
    4 ♙ ♛
    3 ♙
    2 ♙ ♙ ♙
    1 ♕ ♔ ♗ ♘ ♖

    [{'y': 4, 'owner': 0, 'piece': 'pawn', 'x': 6}, {'y': 5, 'owner': 0, 'piece': 'pawn', 'x': 5}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 3}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 4}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 7}, {'y': 7, 'owner': 0, 'piece': 'queen', 'x': 3}, {'y': 7, 'owner': 0, 'piece': 'king', 'x': 4}, {'y': 7, 'owner': 0, 'piece': 'bishop', 'x': 5}, {'y': 7, 'owner': 0, 'piece': 'knight', 'x': 6}, {'y': 7, 'owner': 0, 'piece': 'rook', 'x': 7}, {'prevX': 3, 'y': 4, 'piece': 'queen', 'x': 7, 'owner': 1, 'prevY': 0}, {'y': 0, 'owner': 1, 'piece': 'king', 'x': 4}] 1
    A B C D E F G H
    8 ♛ ♚
    7
    6
    5
    4 ♙ ♛
    3 ♙
    2 ♙ ♙ ♙
    1 ♕ ♔ ♗ ♘ ♖

    How is it 1's turn if 1's queen was just moved (presence of prevX and prevY)??The test just above this one makes more sense as it is almost the same test except it is 0's turn but in this test the placement is exactly same except it is 1's turn which is not logical because 1's queen was just moved.Plus white king is being checked in it but it shows that it is black's turn which is an impossible situation.

  • Default User Avatar

    In the php sample tests, testQueen() has text "Bishop threatens king!", should update to "Queen threatens king!"

  • Custom User Avatar

    Aaaaaaand I have accidentally solved the kata by hardcoding two tests :( Damn, this kata really needs random tests, otherwise it's just easy points. I am aware that creating "real" random setup for various scenarios won't be easy, but maybe just some kind of quasi-randomization, like:

    • randomly flipping the board,
    • randomly flipping the opponents,
    • randomly shuffling the test cases

    would ensure enough variety to make hardcoding infeasible?

  • Custom User Avatar

    Random tests? ;-)

  • Custom User Avatar

    Wow, this is definately harder than I thought it would be. Could you add some test cases for basic checks where some piece blocks the check?