Subversion Repositories Games.Chess Giants

Rev

Rev 33 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33 Rev 108
Line 60... Line 60...
60
      delim = strchr(buffer, '\r');
60
      delim = strchr(buffer, '\r');
61
      if (delim)
61
      if (delim)
62
        *delim = ' ';
62
        *delim = ' ';
63
    } else
63
    } else
64
      break;
64
      break;
65
    strcpy_s(buff, sizeof (buff), buffer); // Pierre-Marie Baty -- use safe version
65
    strcpy(buff, buffer);
66
    nargs = ReadParse(buffer, args, " ;");
66
    nargs = ReadParse(buffer, args, " \t;");
67
    if (!strcmp(args[0], "end"))
67
    if (!strcmp(args[0], "end"))
68
      break;
68
      break;
69
/*
69
/*
70
 ************************************************************
70
 ************************************************************
71
 *                                                          *
71
 *                                                          *
Line 86... Line 86...
86
      SetBoard(tree, nargs, args, 0);
86
      SetBoard(tree, nargs, args, 0);
87
      Castle(0, white) = 0;
87
      Castle(0, white) = 0;
88
      Castle(1, white) = 0;
88
      Castle(1, white) = 0;
89
      Castle(0, black) = 0;
89
      Castle(0, black) = 0;
90
      Castle(1, black) = 0;
90
      Castle(1, black) = 0;
91
      root_wtm = game_wtm;
91
      tree->pawn_score.key = 0;
92
      tree->pawn_score.key = 0;
92
      root_wtm = game_wtm;
93
      s1 = Evaluate(tree, 0, game_wtm, -99999, 99999);
93
      s1 = Evaluate(tree, 0, game_wtm, -99999, 99999);
94
      strcpy_s(buffer, sizeof (buffer), "flop"); // Pierre-Marie Baty -- use safe version
94
      strcpy(buffer, "flop");
95
      (void) Option(tree);
95
      Option(tree);
96
      tree->pawn_score.key = 0;
96
      tree->pawn_score.key = 0;
-
 
97
      root_wtm = game_wtm;
97
      s2 = Evaluate(tree, 0, game_wtm, -99999, 99999);
98
      s2 = Evaluate(tree, 0, game_wtm, -99999, 99999);
98
      strcpy_s(buffer, sizeof (buffer), "flip"); // Pierre-Marie Baty -- use safe version
99
      strcpy(buffer, "flip");
99
      (void) Option(tree);
100
      Option(tree);
100
      tree->pawn_score.key = 0;
101
      tree->pawn_score.key = 0;
-
 
102
      root_wtm = game_wtm;
101
      s3 = Evaluate(tree, 0, game_wtm, -99999, 99999);
103
      s3 = Evaluate(tree, 0, game_wtm, -99999, 99999);
102
      strcpy_s(buffer, sizeof (buffer), "flop"); // Pierre-Marie Baty -- use safe version
104
      strcpy(buffer, "flop");
103
      (void) Option(tree);
105
      Option(tree);
104
      tree->pawn_score.key = 0;
106
      tree->pawn_score.key = 0;
-
 
107
      root_wtm = game_wtm;
105
      s4 = Evaluate(tree, 0, game_wtm, -99999, 99999);
108
      s4 = Evaluate(tree, 0, game_wtm, -99999, 99999);
106
/*
109
/*
107
 ************************************************************
110
 ************************************************************
108
 *                                                          *
111
 *                                                          *
109
 *  If the evaluations (with sign corrected if piece color  *
112
 *  If the evaluations (with sign corrected if piece color  *
Line 113... Line 116...
113
 *                                                          *
116
 *                                                          *
114
 ************************************************************
117
 ************************************************************
115
 */
118
 */
116
      if (s1 != s2 || s1 != s3 || s1 != s4 || s2 != s3 || s2 != s4 ||
119
      if (s1 != s2 || s1 != s3 || s1 != s4 || s2 != s3 || s2 != s4 ||
117
          s3 != s4) {
120
          s3 != s4) {
118
        strcpy_s(buffer, sizeof (buffer), "flip"); // Pierre-Marie Baty -- use safe version
121
        strcpy(buffer, "flip");
119
        (void) Option(tree);
122
        Option(tree);
120
        printf("FEN = %s\n", buff);
123
        printf("FEN = %s\n", buff);
121
        DisplayChessBoard(stdout, tree->position);
124
        DisplayChessBoard(stdout, tree->position);
122
        if (id)
125
        if (id)
123
          Print(4095, "id=%s  ", args[id + 1]);
126
          Print(4095, "id=%s  ", args[id + 1]);
124
        Print(4095, "wtm=%d  score=%d  %d (flop)  %d (flip)  %d (flop)\n",
127
        Print(4095, "wtm=%d  score=%d  %d (flop)  %d (flip)  %d (flop)\n",