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.
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
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
Thank you !!! ;)
I know it and waiting during more than month till somebody accept updated description :(
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.
Could someone accept c# translation with updated description?
Done, updated description waiting for approving
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.
The Side property is not found neither the OutputBoard method. Can you update the description?
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:
would ensure enough variety to make hardcoding infeasible?