}
else if (strcmp(s, "depth") == 0)
{
- dsp->ChangeSearchDepth();
+ dsp->ChangeSearchDepth(sx + strlen("depth"));
}
else if (strcmp(s, "hashdepth") == 0)
{
void
-Curses_ChangeSearchDepth(void)
+Curses_ChangeSearchDepth(char* sx)
{
Curses_ShowMessage("depth = ");
FLUSH_SCANW("%hd", &MaxSearchDepth);
void (*ChangeAlphaWindow)(void);
void (*ChangeBetaWindow)(void);
void (*ChangeHashDepth)(void);
- void (*ChangeSearchDepth)(void);
+ void (*ChangeSearchDepth)(char *sx);
void (*ChangeXwindow)(void);
void (*ClearScreen)(void);
void (*DoDebug)(void);
void
-Raw_ChangeSearchDepth(void)
+Raw_ChangeSearchDepth(char *sx)
{
- printf("depth = ");
- scanf("%hd", &MaxSearchDepth);
+ char buf[80+1];
+ strncpy(buf, sx, 80); buf[80] = '\0';
+ /* if line empty, ask for input */
+ if (!buf[0]) {
+ printf("depth = ");
+ fgets(buf, 80+1, stdin);
+ }
+ sscanf(buf, "%hd", &MaxSearchDepth);
TCflag = !(MaxSearchDepth > 0);
}