} \r
}\r
\r
-#if 0\r
-inline int\r
-AddMove (int i, int x, int y)\r
-{\r
- if(board[y] == EDGE) return 1;\r
- if(board[y] == EMPTY) { // non-capt\r
- if((flagBoard[x] | flagBoard[y]) & p[i].flags) { // promotion possible\r
- moveStack[msp++] = moveStack[nonCapts];\r
- moveStack[nonCapts++] |= PROMOTE | p[i].flags << 24;\r
- if(!(p[i].flags & ALWAYS_PROMOTE))\r
- moveStack[msp++] = x << SQLEN | y; // push deferral as well\r
- else moveStack[msp++] = x << SQLEN | y; // normal move\r
- }\r
- } else { // capture\r
- if(((board[y] ^ i) & 1) return 1; // own\r
- moveStack[msp++] = moveStack[nonCapts];\r
- moveStack[nonCapts++] = moveStack[promotions];\r
- moveStack[promotions++] = x << SQLEN | y;\r
- if((flagBoard[x] | flagBoard[y]) & p[i].flags) { // promotion possible\r
- int p = promotions;\r
- if(!(p[i].flags & ALWAYS_PROMOTE)) {\r
- moveStack[msp++] = moveStack[nonCapts];\r
- moveStack[nonCapts++] = moveStack[promotions];\r
- moveStack[promotions++] = moveStack[p-1];\r
- }\r
- moveStack[p-1] += PROMOTE | p[i].flags<<24;\r
- }\r
- return 1; // capture ends ray scan\r
- }\r
- return 0;\r
-}\r
-#endif\r
-\r
int flag;\r
\r
inline int\r
return 0;\r
}\r
\r
-#if 0\r
-void\r
-GenAllMoves ()\r
-{\r
- int i, j, k;\r
- promotions = nonCapts = msp;\r
- for(i=stm+2; i<=last[stm]; i+=2) {\r
- int x = p[i].pos;\r
- if(x == ABSENT) continue;\r
- for(j=0; j<8; j++) {\r
- int y, v = kStep[j], r = p[i].range[j];\r
- if(r < 0) { // jumping piece, special treatment\r
- if(r >= -3) { // in any case, do a jump of 2\r
- if(board[x + 2*v] == EMPTY)\r
- ADDMOVE(x, x+2*v);\r
- if(r < -1) { // Lion power, also single step\r
- if(board[x + v] == EMPTY)\r
- ADDMOVE(x, x+v);\r
- if(r == -3) { // true Lion, also Knight jump\r
- v = nStep[j];\r
- if(board[x + v] == EMPTY)\r
- ADDMOVE(x, x+v);\r
- }\r
- }\r
- }\r
- continue;\r
- }\r
- y = x;\r
- while(r-- > 0) {\r
- if(board[y+=v] == GUARD) break; // off board\r
- if((board[y] + i & 1) == 0) break; // same color\r
- }\r
- }\r
-}\r
-#endif\r
-\r
int\r
GenNonCapts (int promoSuppress)\r
{\r