Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • 22108737?v=3

    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.

  • Profile pic

    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)

  • 22108737?v=3

    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.

  • Profile pic

    Following up on my previous comment, the API is weird. It passes the player for which the check must be asserted, but this would otherwise be deducible from the last move (which is not always set). There is only one situation for which the previous move is actually relevant. It feels that the API is dirty just because of this one case. Maybe adding a specific method that checks for this? It is also quite obscure to someone with no familiar knowledge of chess

  • Profile pic

    The tests do not set the previous position for any piece, which is in principle no problem if it wasn't in the spec in the first place. I would rely to only look for checks on the side that did not move, but you cannot do this since the parameter is meaningless. Either set it in the tests, or remove from the spec

  • Profile pic

    Thank you !!! ;)

  • 32236948?v=4

    done (hopefully)

  • Profile pic
  • Profile pic

    I know it and waiting during more than month till somebody accept updated description :(

  • 1227032?v=3

    The c# Figure class in the description is not the same as in reality. Ex instead of Side property there is Owner, instead of FigureType is Type.

  • Profile pic

    Could someone accept c# translation with updated description?

  • Profile pic

    Done, updated description waiting for approving

  • Profile pic

    Thanks for tip. Will be fixed soon. You can use Owner property even without description updating.
    It was request from kata's author to change property's name and I forgot to update description too.

  • 12385152?v=3

    The Side property is not found neither the OutputBoard method. Can you update the description?

  • 23709795?v=4

    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?

  • Loading more items...