Author: Robert Hyatt
Date: 09:27:57 12/27/99
Go up one level in this thread
On December 26, 1999 at 10:29:17, Steve McRiley wrote:
>Hi,
>
>I have played quite a few game with Gnuchess 5.00 on ICC (handle GnuChess)
>and I thought I'd fiddle aorund a little with its timemanagment. I
>feel that it does not use the time very well. In almost every game it
>has really alot of time left unused.
>
>Since I dont know much about programming I thought I'd ask a few
>question what to change.
>
>I found the following in cmd.c:
>
> **
> }
> else if (strcmp (cmd, "time") == 0) {
> sscanf (inputstr, "%s %[^\n]", s, inputstr);
> TimeLimit[1^board.side] = atoi(s) / 100;
> **
>I dont really get this,, can somebody explain?
That is just a very complex way of converting the time from xboard/winboard
into a value of 'seconds'. This would work as well:
TimeLimit[1^board.side]=atoi(strstr(inputstr,"time")+5)/100;
atoi will ignore the \n.
It would be better to use strtok() to parse the command once, and then just
grab the parameter you want above, which is how I do it in Crafty:
time=atoi(arg[1])/100;
Bob
>
>
> **
>} else
> suddendeath = 0;
> if (TCTime == 0) {
> SET (flags, TIMECTL);
> SearchTime = TCinc / 2;
> printf("Fischer increment of %d seconds\n",TCinc);
>**
>
>Does this mean that in TC's with increment it is suppose to use the
>increment/2 only to search or what? Can one change this?
>
> **
>{
> SET (flags, TIMECTL);
> MoveLimit[white] = MoveLimit[black] = TCMove - (GameCnt+1)/2;
> TimeLimit[white] = TimeLimit[black] = TCTime * 60;
> if (!(flags & XBOARD)) {
> printf ("Time Control: %d moves in %.2f secs\n",
> MoveLimit[white], TimeLimit[white]);
> printf("Fischer increment of %.2f seconds\n",TCinc);
>**
>
>Here, does the TCMove - (GameCnt+1)/2 mean that it will use the
>(timcontroll+1)/2 seconds to search, like in a 5 0 game it will use
>(5+1)/2=3 seconds?
>If so, this might be good to change if you want to test diffrent
>settings.
>
> **
>if (GameCnt >= 0)
> UnmakeMove (board.side, &Game[GameCnt].move);
> else
> printf ("No moves to undo! \n");
> MoveLimit[board.side]++;
> TimeLimit[board.side] += Game[GameCnt+1].et;
> if (!(flags & XBOARD)) ShowBoard ();
>**
>
>Here, is this something that could be altered?
>
>
>Ive looked through time.c in craftys source but it didnt really help me alot.
>
>
>/McRiley
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.