X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=maxqi.c;h=f050292884ff187a91393f0d331df84b0a1ac1cf;hb=521e08ee53bfc842ae70085867a1bd997ff6ba0f;hp=63c1119e0a53900fe6bb9aadf7c0c2e903c2cd6c;hpb=cb0aa43bfcbd1524688e4b239ae7466144daeb3a;p=fairymax.git diff --git a/maxqi.c b/maxqi.c index 63c1119..f050292 100644 --- a/maxqi.c +++ b/maxqi.c @@ -52,7 +52,7 @@ /* add array for specifying board zones */ /* add zone limiter for each piece */ /* change promotion code to act when crossing river */ -/* remove stalemate code */ +/* remove stalemate code */ /* G) o[] and oo[] made int, to work on big-endian machines */ /***************************************************************************/ @@ -88,9 +88,9 @@ int GetTickCount() // with thanks to Tord gettimeofday(&t, NULL); return t.tv_sec*1000 + t.tv_usec/1000; } -#ifndef INI_FILE -#define INI_FILE "qmax.ini" -#endif +#ifndef INI_FILE +#define INI_FILE "qmax.ini" +#endif #else @@ -330,10 +330,6 @@ int PrintResult(int s) } K=I; cnt = D(s,-I,I,Q,4*S,3); - if(cnt==0 && K==0 && L==0) { - printf("1/2-1/2 {Stalemate}\n"); - return 2; - } if(cnt==-I+1) { if (s == WHITE) printf("0-1 {Black mates}\n"); @@ -386,7 +382,7 @@ void CopyBoard(int s) void PrintVariants() { - int i, j, count=0; char c, buf[80]; + int i, j, count=0; char c = EOF+1, buf[80]; FILE *f; f = fopen(inifile, "r"); @@ -403,8 +399,8 @@ void PrintVariants() fclose(f); } - -int LoadGame(char *name) + +void LoadGame(char *name) { int i, j, count=0; char c, buf[80]; static int currentVariant; @@ -535,7 +531,7 @@ int main(int argc, char **argv) continue; } if (!fgets(line, 256, stdin)) - return; + return 1; if (line[0] == '\n') continue; sscanf(line, "%s", command); @@ -587,7 +583,7 @@ int main(int argc, char **argv) } if (!strcmp(command, "quit")) /* exit engine */ - return; + return 0; if (!strcmp(command, "force")) { /* computer plays neither */ Computer = EMPTY;