• I loved making the Kata! If I had to name 1 thing, it would be that the test are suggesting a particular solution a bit too much. I would have prefered it if the test only check if given certain positions, isMate returns the correct value. With my solution I had to write a lot of helper function just to confirm to the format the tests are implying.

  • duplicate issue

  • Needs random tests.

  • .

  • Very cool and exciting kata!
    Did anyone think that would be a first step to build own chess engine?
    Maybe very basic (use random move at least) but able to make valid moves,
    look if add here handling of specific conditions like stalemate and castling, and here we got formally working engine with support of all chess rules. Is not it great?
    Maybe sometime i could master my own kata on this, if nobody haven't done yet :)

  • yep,algorithms are easy but to keep the code clean and joining everything together is the challenge.

  • Awesome kata!!

  • In c# test expected and but was answers are flipped (at least for isCheck).

  • I just found the same error, Still not fixed :(

  • 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.

  • Is this kate's answer very long?It very hard to me.I think it will cost me a whole day.

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

  • Ideally, all positions need to be clear about the previous move. But, as we both agree that previous position matters for en passant cases only, for tesing purposes you can ommit it if it's not en passant situation as it does not matter what piece made the last move. If you worried about getting an error while reading the previous position, use an error free reading option. Not sure what language you are using, but Python has one.

    Another thing that's not perfect: I encountered one test that is not correct: a king is under a check, but a move belongs to the other player. I provided details in my other post below.

  • Correct, I believe my comment was not clear. What I meant is that the previous position information is useful in this particular case only. It seems the whole parameter is designed around this one case. And also, in some tests the previous position is not correctly set (it is empty)

  • En passant is a case when previous position of the pawns matters. If a pawn just moved you can apply the en passant rule. If you did not use the rule right away you lose the opportunity to capture the en passant pawn.

  • Loading more items...