Author: Antonio Dieguez
Date: 22:56:40 02/14/00
hi! I ask for some help in winboard... i have also very poor knowledge in c/c++
so it cost to me understand this things...
the code that is next is not working, but if the user turn on winboard with
amyan, and make a single move, amyan should answer e7e5 and it doesn't! and I
would like to know why? can somebody explainme?
by the way i just copied and pasted code of tscp for the esqueleton of the
loop.(thanks Tom)
also what does signal do??
thanks bye bye......
# include "cable.cc"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <signal.h>
int main(void)
{
// cable *pensante=new cable();
int bandoCompu=2;
int turno=0;
int max_tiempo=200;
int max_plies=2;
int legal=0,posini=0,posfin=0;
int turnoUsuario=0;
char linea[256], comando[256];
signal(SIGINT, SIG_IGN);
for(;;)
{
fgets(linea, 256, stdin);
if (linea[0] == '\n')
{ continue; }
sscanf(linea, "%s", comando);
if (!strcmp(comando, "xboard")) {
continue;
}
if (!strcmp(comando, "new")) {
bandoCompu=1;
turno=0;
continue;
}
if (!strcmp(comando, "quit"))
{ break; }
if (!strcmp(comando, "force")) {
bandoCompu=2;
continue;
}
if (!strcmp(comando, "white")) {
bandoCompu=1;
continue;
}
if (!strcmp(comando, "black")) {
bandoCompu=0;
continue;
}
if (!strcmp(comando, "go")) {
continue;
}
if (!strcmp(comando, "st")) {
sscanf(linea, "st %d", &max_tiempo);
continue;
}
if (!strcmp(comando, "sd")) {
sscanf(linea, "sd %d", &max_plies);
continue;
}
/*
pensante->invencible->nivel=4;
pensante->juega(0);
printf ("(%d) \n",pensante->jugs[0]);
printf ("(%d) \n",pensante->jugs[1]);
printf("%s%d \n","nodos: ",pensante->invencible->posAnalizadas);
break;
*/
printf("move e7e5");
fflush(stdout);
}
return 0;
}
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.