Subversion Repositories Games.Chess Giants

Rev

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

Rev 108 Rev 154
Line 192... Line 192...
192
 *  past when the move at the previous ply was played.      *
192
 *  past when the move at the previous ply was played.      *
193
 *                                                          *
193
 *                                                          *
194
 ************************************************************
194
 ************************************************************
195
 */
195
 */
196
    case COUNTER_MOVE1:
196
    case COUNTER_MOVE1:
197
      possible = counter_move[tree->curmv[ply - 1] & 4095].move1;
197
      possible = tree->counter_move[tree->curmv[ply - 1] & 4095].move1;
198
      if (!Exclude(tree, ply, possible) &&
198
      if (!Exclude(tree, ply, possible) &&
199
          ValidMove(tree, ply, side, possible)) {
199
          ValidMove(tree, ply, side, possible)) {
200
        tree->curmv[ply] = possible;
200
        tree->curmv[ply] = possible;
201
        *(tree->next_status[ply].exclude++) = possible;
201
        *(tree->next_status[ply].exclude++) = possible;
202
        tree->next_status[ply].phase = COUNTER_MOVE2;
202
        tree->next_status[ply].phase = COUNTER_MOVE2;
203
        tree->phase[ply] = COUNTER_MOVE1;
203
        tree->phase[ply] = COUNTER_MOVE1;
204
        return ++tree->next_status[ply].order;
204
        return ++tree->next_status[ply].order;
205
      }
205
      }
206
    case COUNTER_MOVE2:
206
    case COUNTER_MOVE2:
207
      possible = counter_move[tree->curmv[ply - 1] & 4095].move2;
207
      possible = tree->counter_move[tree->curmv[ply - 1] & 4095].move2;
208
      if (!Exclude(tree, ply, possible) &&
208
      if (!Exclude(tree, ply, possible) &&
209
          ValidMove(tree, ply, side, possible)) {
209
          ValidMove(tree, ply, side, possible)) {
210
        tree->curmv[ply] = possible;
210
        tree->curmv[ply] = possible;
211
        *(tree->next_status[ply].exclude++) = possible;
211
        *(tree->next_status[ply].exclude++) = possible;
212
        tree->next_status[ply].phase = MOVE_PAIR1;
212
        tree->next_status[ply].phase = MOVE_PAIR1;
Line 221... Line 221...
221
 *  pair was played two plies back.                         *
221
 *  pair was played two plies back.                         *
222
 *                                                          *
222
 *                                                          *
223
 ************************************************************
223
 ************************************************************
224
 */
224
 */
225
    case MOVE_PAIR1:
225
    case MOVE_PAIR1:
226
      possible = move_pair[tree->curmv[ply - 2] & 4095].move1;
226
      possible = tree->move_pair[tree->curmv[ply - 2] & 4095].move1;
227
      if (!Exclude(tree, ply, possible) &&
227
      if (!Exclude(tree, ply, possible) &&
228
          ValidMove(tree, ply, side, possible)) {
228
          ValidMove(tree, ply, side, possible)) {
229
        tree->curmv[ply] = possible;
229
        tree->curmv[ply] = possible;
230
        *(tree->next_status[ply].exclude++) = possible;
230
        *(tree->next_status[ply].exclude++) = possible;
231
        tree->next_status[ply].phase = MOVE_PAIR2;
231
        tree->next_status[ply].phase = MOVE_PAIR2;
232
        tree->phase[ply] = MOVE_PAIR1;
232
        tree->phase[ply] = MOVE_PAIR1;
233
        return ++tree->next_status[ply].order;
233
        return ++tree->next_status[ply].order;
234
      }
234
      }
235
    case MOVE_PAIR2:
235
    case MOVE_PAIR2:
236
      possible = move_pair[tree->curmv[ply - 2] & 4095].move2;
236
      possible = tree->move_pair[tree->curmv[ply - 2] & 4095].move2;
237
      if (!Exclude(tree, ply, possible) &&
237
      if (!Exclude(tree, ply, possible) &&
238
          ValidMove(tree, ply, side, possible)) {
238
          ValidMove(tree, ply, side, possible)) {
239
        tree->curmv[ply] = possible;
239
        tree->curmv[ply] = possible;
240
        *(tree->next_status[ply].exclude++) = possible;
240
        *(tree->next_status[ply].exclude++) = possible;
241
        tree->next_status[ply].phase = GENERATE_QUIET;
241
        tree->next_status[ply].phase = GENERATE_QUIET;
Line 464... Line 464...
464
        if (Flip(side))
464
        if (Flip(side))
465
          printf("... ");
465
          printf("... ");
466
        strcpy(mytree->root_move_text, OutputMove(tree, 1, side,
466
        strcpy(mytree->root_move_text, OutputMove(tree, 1, side,
467
                tree->curmv[1]));
467
                tree->curmv[1]));
468
        total_nodes = block[0]->nodes_searched;
468
        total_nodes = block[0]->nodes_searched;
469
        for (t = 0; t < (int) smp_max_threads; t++) // Pierre-Marie Baty -- added type cast
469
        for (t = 0; t < smp_max_threads; t++)
470
          for (i = 0; i < 64; i++)
470
          for (i = 0; i < 64; i++)
471
            if (!(thread[t].blocks & SetMask(i)))
471
            if (!(thread[t].blocks & SetMask(i)))
472
              total_nodes += block[t * 64 + 1 + i]->nodes_searched;
472
              total_nodes += block[t * 64 + 1 + i]->nodes_searched;
473
        nodes_per_second = (unsigned int) (total_nodes * 100 / Max(end_time - start_time, 1)); // Pierre-Marie Baty -- added type cast
473
        nodes_per_second = total_nodes * 100 / Max(end_time - start_time, 1);
474
        i = strlen(mytree->root_move_text);
474
        i = strlen(mytree->root_move_text);
475
        i = (i < 8) ? i : 8;
475
        i = (i < 8) ? i : 8;
476
        strncat(mytree->root_move_text, "          ", 8 - i);
476
        strncat(mytree->root_move_text, "          ", 8 - i);
477
        printf("%s", mytree->root_move_text);
477
        printf("%s", mytree->root_move_text);
478
        printf("(%snps)             \r", DisplayKMB(nodes_per_second, 0));
478
        printf("(%snps)             \r", DisplayKMB(nodes_per_second, 0));