int Ticks, tlim, Setup, SetupQ;\r
\r
int GameHistory[1024];\r
-char HistoryBoards[1024][STATE], setupPosition[131];\r
+char HistoryBoards[1024][STATE], setupPosition[162];\r
int GamePtr, HistPtr;\r
\r
#define W while\r
of[256],\r
od[16]; /* 1st dir. in o[] per piece*/\r
\r
-signed char L,pl[17],\r
+signed char L,pl[32],\r
b[513], /* board: 16x8+dummy, + PST */\r
T[4104], /* hash translation table */\r
centr[32],\r
((b[G=r<0?x&~15:BW-1|x&112]^32)<33 /* no virgin R in corner G, */\r
||b[G^1]|b[G^2]|b[FF=y+v-r]) /* no 2 empty sq. next to R */\r
)t+=flag&4; /* fake capt. for nonsliding*/\r
- else F=y; /* enable e.p. */\r
+ else if(flag&64)t=flag&128?0:t,flag&=63;else F=y; /* enable e.p. */\r
if(s&&flag&8)t=0,flag^=flag>>4&15; /* hoppers go to next phase */\r
if(!(flag&S)) /* zig-zag piece? */\r
r=v,flag^=flag>>4&15; /* alternate vector & mode */\r
InitGame();\r
if(Setup) {\r
for(i=0; i<128; i++) b[i] = setupPosition[i];\r
+ for(i=0; i<32; i++) pl[i] = setupPosition[i+130];\r
Side = setupPosition[128]; Q = SetupQ;\r
- pl[WHITE] = setupPosition[129];\r
- pl[BLACK] = setupPosition[130];\r
+ R = setupPosition[129];\r
}\r
for(i=0; i<=U; i++) A[i].D = A[i].K = 0; // clear hash table\r
for(nr=0; nr<GamePtr; nr++) {\r
GamePtr = HistPtr = 0; Setup = 1; SetupQ = Q; // start anew\r
for(i=0; i<128; i++) setupPosition[i] = b[i]; // remember position\r
setupPosition[128] = Side;\r
- setupPosition[129] = pl[WHITE];\r
- setupPosition[130] = pl[BLACK];\r
+ setupPosition[129] = R;\r
+ for(i=0; i<32; i++) setupPosition[i+130] = pl[i];\r
continue;\r
}\r
/* command not recognized, assume input move */\r