Skip to content

Commit f9677e5

Browse files
Daniel WhiteDaniel White
authored andcommitted
Now store black's back rank pieces in T array to setup board, rather than white's. Saves 1 byte.
1 parent 07c81c3 commit f9677e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

iota.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define Z ;if(!strncmp(c,
99

1010
char c[Q], *C,
11-
*T="#5)-57234#15BD#24#24$3#(.)$?).(/.2##$"; // Piece move steps, board setup data and promotion XORs (subtract '#'=35).
11+
*T="#5)-57234#15BD#24#24$3#EKFA\\FKE/.2##$"; // Piece move steps, board setup data and promotion XORs (subtract '#'=35).
1212

1313
B[Q], R, S, W, X;
1414

@@ -76,7 +76,7 @@ main(i, p) {
7676
Z"p",1)) { // Parse 'position' command.
7777
N i=0;i<8;++i) // Reset board to start position.
7878
B[i+16]=R=170,B[i+96]=202, // Pawns.
79-
B[i+112]=(B[i]=T[i+23]-3)+(S=32), // Pieces.
79+
B[i]=(B[i+112]=T[i+23])-(S=32), // Pieces.
8080
B[i+S]=B[i+48]=B[i+64]=B[i+80]=0; // Empty rows.
8181
N ;C=strtok(0," ");)
8282
F(*C+C[1]*16-881, C[2]+C[3]*16-881, C[4], R);

0 commit comments

Comments
 (0)