logoalt Hacker News

efitzlast Friday at 9:06 PM1 replyview on HN

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


Replies

vntoklast Friday at 9:14 PM

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