Skip to content

Commit fb8b9ae

Browse files
Daniel WhiteDaniel White
authored andcommitted
Saved 2 bytes in castling code.
1 parent be3ab97 commit fb8b9ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iota.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ F(U, V, p, r) {
4141
B[t]^=T[p%7+31]-35; // Promotion.
4242
S^=96;
4343
I P&16 && t!=f+d)
44-
B[f+t>>1]=B[t+(d>0?1:-2)],B[t+(d>0?1:-2)]=0; // If castling also move rook.
44+
B[f+t>>1]=B[t+(d*3-1)/2],B[t+(d*3-1)/2]=0; // If castling also move rook.
4545

4646
// Looking to make a move? (if our own move, make sure does not leave us in check)
4747
I (t==V && f==U) | (U==Q && F(8,0,0,Q))) {

0 commit comments

Comments
 (0)