Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If the rook has the king's position, it's never moved. As soon as it moves, it can have any position except the king's.


To make this work, the rook can only have the king's position, if neither the king nor that rook have moved.


How do you differentiate between "never moved" and "moved but moved back"?


If the rook has not ever moved yet, it gets the king's positional value. As both pieces can't overlap, assume the king's positional value is correct and the rook is at starting position.

Then, as soon as the rook is moved, it gets its actual positional value. If it moves back later, the positional value will be that of the rook's starting position (guaranteed different from the king's current positional value as the two pieces can't overlap).


It would be if castle is available, not simply if the rook has never moved.

Likewise, the position of a pawn can be assigned the king’s position if it has made the double move. You know it’s actually in the legal file and in which rank it sits after the move.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: