Skip to content

Commit 7d38e4b

Browse files
Daniel WhiteDaniel White
authored andcommitted
Modified how we use loop variable i in main() to save 2 bytes.
1 parent f25ed09 commit 7d38e4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

iota.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ D(x, y, p, e) {
6767
}
6868

6969
main(i) {
70-
F ;strtok(gets(c)," ");fflush(0)) { // Loop, grabbing input and flushing output.
70+
F ;strtok(gets(c)," ");fflush(i=0)) { // Loop, grabbing input and flushing output.
7171
Z"uci",4)) puts("id name i\nid author D\nuciok") // Reply to 'uci'.
7272
Z"i",1)) puts("readyok") // Reply to 'isready'.
7373
Z"p",1)) { // Parse 'position' command.
74-
F i=0;i<8;++i) // Reset board to start position.
75-
B[i+16]=E=170,B[i+96]=202, // Pawns.
74+
F ;i<8;) // Reset board to start position.
7675
B[i]=(B[i+112]=T[i+23])-(S=32), // Pieces.
77-
B[i+S]=B[i+48]=B[i+64]=B[i+80]=0; // Empty rows.
76+
B[i+S]=B[i+48]=B[i+64]=B[i+80]=0, // Empty rows.
77+
B[i+16]=E=170,B[i+++96]=202; // Pawns.
7878
F ;C=strtok(0," ");)
7979
D(*C+C[1]*16-881, C[2]+C[3]*16-881, C[4], E);
8080
}

0 commit comments

Comments
 (0)