diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-02 19:51:43 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-02 19:51:43 +0000 |
commit | fc6a32e8de76dc96c5fb6cf8872a44ed22ac5bac (patch) | |
tree | 1d3427d4e78a0c804e47d946fdd4e01b6845a48e /gnu/games | |
parent | 53bde7aa54dba785761adf2e07bce713745dca5c (diff) |
Update for modern curses implementation
Diffstat (limited to 'gnu/games')
-rw-r--r-- | gnu/games/chess/gnuchess.c | 28 | ||||
-rw-r--r-- | gnu/games/chess/gnuchess.h | 6 | ||||
-rw-r--r-- | gnu/games/chess/nondsp.c | 12 | ||||
-rw-r--r-- | gnu/games/chess/uxdsp.c | 10 |
4 files changed, 28 insertions, 28 deletions
diff --git a/gnu/games/chess/gnuchess.c b/gnu/games/chess/gnuchess.c index 2eeb0565f51..baca91f4f28 100644 --- a/gnu/games/chess/gnuchess.c +++ b/gnu/games/chess/gnuchess.c @@ -25,7 +25,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: gnuchess.c,v 1.2 1995/12/21 14:50:10 deraadt Exp $"; +static char rcsid[] = "$Id: gnuchess.c,v 1.3 1996/06/02 19:51:39 tholo Exp $"; #endif /* not lint */ #include <stdio.h> @@ -135,8 +135,8 @@ short c1,c2,*atk1,*atk2,*PC1,*PC2,EnemyKing; short mate,post,opponent,computer,Sdepth,Awindow,Bwindow,dither; long ResponseTime,ExtraTime,Level,et,et0,time0,cputimer,ft; long NodeCnt,evrate,ETnodes,EvalNodes,HashCnt; -short quit,reverse,bothsides,hashflag,InChk,player,force,easy,beep; -short wking,bking,FROMsquare,TOsquare,timeout,Zscore,zwndw,xwndw,slk; +short quit,reverse,bothsides,hashflag,InChk,player,force,easy,beepit; +short wking,bking,FROMsquare,TOsquare,timeo,Zscore,zwndw,xwndw,slk; short INCscore; short HasPawn[2],HasKnight[2],HasBishop[2],HasRook[2],HasQueen[2]; short ChkFlag[maxdepth],CptrFlag[maxdepth],PawnThreat[maxdepth]; @@ -405,7 +405,7 @@ short l,r,c,p; mate = quit = reverse = bothsides = post = false; hashflag = force = PawnStorm = false; - beep = rcptr = easy = true; + beepit = rcptr = easy = true; lpost = NodeCnt = epsquare = et0 = 0; dither = 0; Awindow = 90; @@ -478,7 +478,7 @@ short side,iop; { static short i,alpha,beta,score,tempb,tempc,tempsf,tempst,xside,rpt; - timeout = false; + timeo = false; xside = otherside[side]; if (iop != 2) player = side; if (TCflag) @@ -515,12 +515,12 @@ static short i,alpha,beta,score,tempb,tempc,tempsf,tempst,xside,rpt; MoveList(side,1); for (i = TrPnt[1]; i < TrPnt[2]; i++) pick(i,TrPnt[2]-1); if (Book != NULL) OpeningBook(); - if (Book != NULL) timeout = true; + if (Book != NULL) timeo = true; NodeCnt = ETnodes = EvalNodes = HashCnt = 0; Zscore = 0; zwndw = 20; } - while (!timeout && Sdepth < MaxSearchDepth) + while (!timeo && Sdepth < MaxSearchDepth) { Sdepth++; ShowDepth(' '); @@ -541,17 +541,17 @@ static short i,alpha,beta,score,tempb,tempc,tempsf,tempst,xside,rpt; score = search(side,1,Sdepth,alpha,9000,PrVar,&rpt); } score = root->score; - if (!timeout) + if (!timeo) for (i = TrPnt[1]+1; i < TrPnt[2]; i++) pick(i,TrPnt[2]-1); ShowResults(score,PrVar,'.'); for (i = 1; i <= Sdepth; i++) killr0[i] = PrVar[i]; if (score > Zscore-zwndw && score > Tree[1].score+250) ExtraTime = 0; else if (score > Zscore-3*zwndw) ExtraTime = ResponseTime; else ExtraTime = 3*ResponseTime; - if (root->flags & exact) timeout = true; - if (Tree[1].score < -9000) timeout = true; - if (4*et > 2*ResponseTime + ExtraTime) timeout = true; - if (!timeout) + if (root->flags & exact) timeo = true; + if (Tree[1].score < -9000) timeo = true; + if (4*et > 2*ResponseTime + ExtraTime) timeo = true; + if (!timeo) { Tscore[0] = score; if (Zscore == 0) Zscore = score; @@ -764,7 +764,7 @@ struct leaf *node,tmp; node->reply = nxtline[ply+1]; UnmakeMove(side,node,&tempb,&tempc,&tempsf,&tempst); } - if (node->score > best && !timeout) + if (node->score > best && !timeo) { if (depth > 0) if (node->score > alpha && !(node->flags & exact)) @@ -790,7 +790,7 @@ struct leaf *node,tmp; } } if (NodeCnt > ETnodes) ElapsedTime(0); - if (timeout) return(-Tscore[ply-1]); + if (timeo) return(-Tscore[ply-1]); } node = &Tree[pbst]; diff --git a/gnu/games/chess/gnuchess.h b/gnu/games/chess/gnuchess.h index 4d4d1d84161..e71b1e3b75a 100644 --- a/gnu/games/chess/gnuchess.h +++ b/gnu/games/chess/gnuchess.h @@ -19,7 +19,7 @@ file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. - $Id: gnuchess.h,v 1.1 1995/10/18 08:41:11 deraadt Exp $ + $Id: gnuchess.h,v 1.2 1996/06/02 19:51:41 tholo Exp $ */ @@ -83,8 +83,8 @@ extern short c1,c2,*atk1,*atk2,*PC1,*PC2; extern short mate,post,opponent,computer,Sdepth,Awindow,Bwindow,dither; extern long ResponseTime,ExtraTime,Level,et,et0,time0,cputimer,ft; extern long NodeCnt,evrate,ETnodes,EvalNodes,HashCnt; -extern short quit,reverse,bothsides,hashflag,InChk,player,force,easy,beep,meter; -extern short timeout,xwndw; +extern short quit,reverse,bothsides,hashflag,InChk,player,force,easy,beepit,meter; +extern short timeo,xwndw; extern struct GameRec GameList[240]; extern short GameCnt,Game50,epsquare,lpost,rcptr,contempt; extern short MaxSearchDepth; diff --git a/gnu/games/chess/nondsp.c b/gnu/games/chess/nondsp.c index ca89c936bd9..ae0c3c2df90 100644 --- a/gnu/games/chess/nondsp.c +++ b/gnu/games/chess/nondsp.c @@ -25,7 +25,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: nondsp.c,v 1.1 1995/10/18 08:41:11 deraadt Exp $"; +static char rcsid[] = "$Id: nondsp.c,v 1.2 1996/06/02 19:51:41 tholo Exp $"; #endif /* not lint */ #include <stdio.h> @@ -84,7 +84,7 @@ char s[80]; TerminateSearch() { - timeout = true; + timeo = true; bothsides = false; } #endif MSDOS @@ -159,7 +159,7 @@ char s[80]; if (strcmp(s,"list") == 0) ListGame(); if (strcmp(s,"level") == 0) SelectLevel(); if (strcmp(s,"hash") == 0) hashflag = !hashflag; - if (strcmp(s,"beep") == 0) beep = !beep; + if (strcmp(s,"beep") == 0) beepit = !beepit; if (strcmp(s,"Awindow") == 0) ChangeAlphaWindow(); if (strcmp(s,"Bwindow") == 0) ChangeBetaWindow(); if (strcmp(s,"rcptr") == 0) rcptr = !rcptr; @@ -406,7 +406,7 @@ OutputMove() if (root->flags & epmask) UpdateDisplay(0,0,1,0); else UpdateDisplay(root->f,root->t,0,root->flags & cstlmask); printz("My move is: %s\n\n",mvstr1); - if (beep) printz("%c",7); + if (beepit) printz("%c",7); if (root->flags & draw) printz("Draw game!\n"); else if (root->score == -9999) printz("opponent mates!\n"); @@ -432,7 +432,7 @@ short iop; ETnodes += 50; if (et > et0 || iop == 1) { - if (et > ResponseTime+ExtraTime && Sdepth > 1) timeout = true; + if (et > ResponseTime+ExtraTime && Sdepth > 1) timeo = true; et0 = et; if (iop == 1) { @@ -443,7 +443,7 @@ short iop; if (et > 0) evrate = NodeCnt/(et+ft); else evrate = 0; if (kbhit() && Sdepth > 1) { - timeout = true; + timeo = true; bothsides = false; } #else diff --git a/gnu/games/chess/uxdsp.c b/gnu/games/chess/uxdsp.c index a0a5ba2599d..0973b693e0b 100644 --- a/gnu/games/chess/uxdsp.c +++ b/gnu/games/chess/uxdsp.c @@ -25,7 +25,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: uxdsp.c,v 1.1 1995/10/18 08:41:11 deraadt Exp $"; +static char rcsid[] = "$Id: uxdsp.c,v 1.2 1996/06/02 19:51:42 tholo Exp $"; #endif /* not lint */ #include <stdio.h> @@ -82,7 +82,7 @@ TerminateSearch() { signal(SIGINT,SIG_IGN); signal(SIGQUIT,SIG_IGN); - timeout = true; + timeo = true; bothsides = false; signal(SIGINT,Die); signal(SIGQUIT,Die); } @@ -157,7 +157,7 @@ char s[80]; if (strcmp(s,"list") == 0) ListGame(); if (strcmp(s,"level") == 0) SelectLevel(); if (strcmp(s,"hash") == 0) hashflag = !hashflag; - if (strcmp(s,"beep") == 0) beep = !beep; + if (strcmp(s,"beep") == 0) beepit = !beepit; if (strcmp(s,"Awindow") == 0) ChangeAlphaWindow(); if (strcmp(s,"Bwindow") == 0) ChangeBetaWindow(); if (strcmp(s,"hint") == 0) GiveHint(); @@ -391,7 +391,7 @@ OutputMove() if (root->flags & epmask) UpdateDisplay(0,0,1,0); else UpdateDisplay(root->f,root->t,0,root->flags & cstlmask); gotoXY(50,17); printz("My move is: %s",mvstr1); - if (beep) putchar(7); + if (beepit) putchar(7); ClrEoln(); gotoXY(50,24); @@ -425,7 +425,7 @@ short iop; ETnodes += 50; if (et > et0 || iop == 1) { - if (et > ResponseTime+ExtraTime && Sdepth > 1) timeout = true; + if (et > ResponseTime+ExtraTime && Sdepth > 1) timeo = true; et0 = et; if (iop == 1) { |