Skip to content

Commit eb639a9

Browse files
Daniel WhiteDaniel White
authored andcommitted
Created R macro to replace 'return'. Saves 7 bytes.
1 parent ab5e577 commit eb639a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

iota.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define H 99999
33
#define I ;if(
44
#define K )break;
5+
#define R return
56
#define Z ;if(!strncmp(c,
67

78
char c[H], *C,
@@ -29,7 +30,7 @@ D(x, y, p, e) {
2930

3031
// Other side left in check?
3132
I x==8 && v&16)
32-
return 0;
33+
R 0;
3334

3435
// Make move.
3536
B[t]=m%128;
@@ -44,7 +45,7 @@ D(x, y, p, e) {
4445
I (t==y & f==x) | (x==H && D(8,0,0,H))) {
4546
X=f,Y=t;
4647
E= m%8==2&t!=f+d ? f+t>>1 : 9; // Set ep-target square if double pawn move.
47-
return B[t]==m%128; // Indicate if promotion has NOT occured.
48+
R B[t]==m%128; // Indicate if promotion has NOT occured.
4849
}
4950

5051
// Undo move.
@@ -59,7 +60,7 @@ D(x, y, p, e) {
5960
}
6061
}
6162
}
62-
return 1;
63+
R 1;
6364
}
6465

6566
main(i) {

0 commit comments

Comments
 (0)