Skip to content

Commit c8ca010

Browse files
Daniel WhiteDaniel White
authored andcommitted
Modified to-square loop and invalid square testing to save 2 bytes.
1 parent 309f811 commit c8ca010

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

iota.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ F(U, V, p, r) {
1515
int f=0,t, i, d, P, u, q;
1616
N ;f<128;f=f+9&~8) { // Loop over squares looking for pieces.
1717
N i=T[(P=B[f])&7]-35,d=0;d<0 || (d=T[i++]-35);d=-d) { // Loop over move steps for this piece.
18-
N t=f+d;P&S;t+=d) { // Loop over destination squares in this direction.
19-
// Invalid square or friendly capture?
20-
I (t&(q=136)) || ((u=B[t])&S) M
18+
N t=f;!((t+=d)&(q=136)) && P&S;) { // Loop over destination squares in this direction.
19+
// Friendly capture?
20+
I (u=B[t])&S M
2121

2222
// Special pawn logic.
2323
I P%8==2)

0 commit comments

Comments
 (0)