7 static void adjust_fmg( void );
8 static int ini_hash( void );
9 static int set_root_alpha( int nfail_low, int root_alpha_old );
10 static int set_root_beta( int nfail_high, int root_beta_old );
11 static int is_answer_right( unsigned int move );
12 static const char *str_fail_high( int turn, int nfail_high );
15 static int rep_book_prob( tree_t * restrict ptree )
19 for ( i = root_nrep - 2; i >= 0; i -= 2 )
20 if ( ptree->rep_board_list[i] == HASH_KEY
21 && ptree->rep_hand_list[i] == HAND_B )
23 Out( "- book is ignored due to a repetition.\n" );
32 iterate( tree_t * restrict ptree, int flag )
34 int value, iret, ply, is_hash_learn_stored;
35 unsigned int cpu_start;
36 int right_answer_made;
38 /* probe the opening book */
39 if ( pf_book != NULL && n_nobook_move < 7 && ! rep_book_prob( ptree ) )
44 is_book_hit = book_probe( ptree );
45 if ( is_book_hit < 0 ) { return is_book_hit; }
47 iret = get_elapsed( &elapsed );
48 if ( iret < 0 ) { return iret; }
50 Out( "- opening book is probed. (%ss)\n",
51 str_time_symple( elapsed - time_start ) );
54 pv_close( ptree, 2, book_hit );
55 last_pv = ptree->pv[1];
58 if ( ! ( game_status & flag_puzzling ) )
60 for ( i = 0; i < HIST_SIZE; i++ )
62 ptree->hist_good[i] /= 256U;
63 ptree->hist_tried[i] /= 256U;
67 MnjOut( "pid=%d move=%s v=0b n=0 confident\n", mnj_posi_id,
68 str_CSA_move(ptree->pv[1].a[1]) );
72 if ( ! ( game_status & ( flag_puzzling | flag_pondering ) ) )
78 /* initialize variables */
79 if ( get_cputime( &cpu_start ) < 0 ) { return -1; }
81 ptree->node_searched = 0;
82 ptree->nreject_done = 0;
83 ptree->nreject_tried = 0;
84 ptree->null_pruning_done = 0;
85 ptree->null_pruning_tried = 0;
86 ptree->check_extension_done = 0;
87 ptree->recap_extension_done = 0;
88 ptree->onerp_extension_done = 0;
89 ptree->nfour_fold_rep = 0;
90 ptree->nperpetual_check = 0;
91 ptree->nsuperior_rep = 0;
92 ptree->nrep_tried = 0;
93 ptree->neval_called = 0;
94 ptree->nquies_called = 0;
95 ptree->ntrans_always_hit = 0;
96 ptree->ntrans_prefer_hit = 0;
97 ptree->ntrans_probe = 0;
98 ptree->ntrans_exact = 0;
99 ptree->ntrans_lower = 0;
100 ptree->ntrans_upper = 0;
101 ptree->ntrans_superior_hit = 0;
102 ptree->ntrans_inferior_hit = 0;
103 ptree->fail_high = 0;
104 ptree->fail_high_first = 0;
105 ptree->current_move[0] = 0;
106 ptree->pv[0].a[0] = 0;
107 ptree->pv[0].a[1] = 0;
108 ptree->pv[0].depth = 0;
109 ptree->pv[0].length = 0;
113 right_answer_made = 0;
114 is_hash_learn_stored = 0;
117 root_value = -score_bound;
118 root_alpha = -score_bound;
119 root_beta = score_bound;
122 time_last_eff_search = time_start;
123 time_last_check = time_start;
124 game_status &= ~( flag_move_now | flag_suspend
125 | flag_quit_ponder | flag_search_error );
126 #if defined(DBG_EASY)
131 ptree->tlp_abort = 0;
138 if ( ! ( game_status & flag_puzzling ) && mpv_num > 1 )
142 for ( i = 0; i < 2*mpv_num+1; i++ ) { mpv_pv[i].length = 0; }
152 else { root_mpv = 0; }
156 for ( ply = 0; ply < PLY_MAX; ply++ )
158 ptree->amove_killer[ply].no1 = ptree->amove_killer[ply].no2 = 0U;
159 ptree->killers[ply].no1 = ptree->killers[ply].no2 = 0x0U;
163 unsigned int u = node_per_second / 16U;
164 if ( u > TIME_CHECK_MAX_NODE ) { u = TIME_CHECK_MAX_NODE; }
165 else if ( u < TIME_CHECK_MIN_NODE ) { u = TIME_CHECK_MIN_NODE; }
166 node_next_signal = u;
169 set_search_limit_time( root_turn );
172 /* look up last pv. */
173 if ( last_pv.length )
175 Out( "- a pv was found in the previous search result.\n" );
177 iteration_depth = last_pv.depth;
178 ptree->pv[0] = last_pv;
179 ptree->pv[0].type = prev_solution;
180 root_value = root_turn ? -last_root_value : last_root_value;
181 out_pv( ptree, root_value, root_turn, 0 );
185 /* probe the transposition table, since last pv is not available. */
186 if ( ! last_pv.length
192 unsigned int value_type;
196 if ( iret < 0 ) { return iret; }
197 is_hash_learn_stored = 1;
200 for ( ply = 1; ply < PLY_MAX - 10; ply++ )
202 alpha = -score_bound;
205 value_type = hash_probe( ptree, 1, ply*PLY_INC+PLY_INC/2,
206 root_turn, alpha, beta, 0 );
207 if ( value_type != value_exact ) { break; }
211 if ( -score_bound < value )
213 Out( "- a pv was peeked through the transposition table.\n" );
214 iteration_depth = ply-1;
215 ptree->pv[0].depth = (unsigned char)(ply-1);
216 ptree->pv[0].type = hash_hit;
218 out_pv( ptree, value, root_turn, 0 );
221 if ( ! ptree->pv[0].length )
224 ptree->pv[0].depth = 0;
225 root_value = -score_bound;
226 #if ! defined(MINIMUM)
227 out_warning( "PEEK FAILED!!!" );
233 /* root move generation */
235 unsigned int elapsed;
237 Out( "- root move generation" );
238 value = make_root_move_list( ptree, flag );
239 if ( game_status & flag_search_error ) { return -1; }
240 if ( game_status & ( flag_quit | flag_quit_ponder | flag_suspend ) )
247 str_error = "No legal moves to search";
251 if ( ! ptree->pv[0].length || ptree->pv[0].a[1] != root_move_list[0].move )
254 ptree->pv[0].a[1] = root_move_list[0].move;
255 ptree->pv[0].length = 1;
256 ptree->pv[0].depth = 1;
257 ptree->pv[0].type = no_rep;
264 if ( root_nmove == 1 ) { root_mpv = 0; }
269 if ( get_elapsed( &elapsed ) < 0 ) { return -1; }
270 Out( " ... done (%d moves, %ss)\n",
271 root_nmove, str_time_symple( elapsed - time_start ) );
275 /* save preliminary result */
276 assert( root_value != -score_bound );
277 last_root_value = root_turn ? -root_value : root_value;
278 last_pv = ptree->pv[0];
281 if ( sckt_mnj != SCKT_NULL )
283 const char *str = ( root_nmove == 1 ) ? "confident" : "";
285 MnjOut( "pid=%d move=%s v=%de n=%" PRIu64 " %s\n",
286 mnj_posi_id, str_CSA_move(ptree->pv[0].a[1]), root_value,
287 ptree->node_searched, str );
291 /* return, if previous pv is long enough */
292 if ( abs(root_value) > score_max_eval
293 || iteration_depth >= depth_limit
294 || ( ( game_status & flag_puzzling )
295 && ( root_nmove == 1 || ptree->pv[0].depth > 4 ) ) )
300 if ( ! is_hash_learn_stored )
303 if ( iret < 0 ) { return iret; }
306 /* iterative deepening search */
309 if ( iret < 0 ) { return iret; }
311 iteration_depth += 1;
312 root_beta = set_root_beta( 0, root_value );
313 root_alpha = set_root_alpha( 0, root_value );
314 root_value = root_alpha;
315 add_rejections( ptree, root_turn, 1 );
316 Out( "- drive an iterative deepening search starting from depth %d\n",
319 for ( ; iteration_depth < 30/*PLY_MAX-10*/; iteration_depth++ ) {
321 MnjOut( "pid=%d d=%d\n", mnj_posi_id, iteration_depth );
324 if ( get_elapsed( &time_last_search ) < 0 ) { return -1; }
330 i = ( root_nmove < mpv_num ) ? root_nmove : mpv_num;
331 for ( ; i < mpv_num*2; i++ ) { mpv_pv[i].length = 0; }
340 for ( ply = 1; ply <= ptree->pv[0].length; ply++ )
342 move = ptree->pv[0].a[ply];
343 if ( ! is_move_valid( ptree, move, tt ) )
345 #if ! defined(MINIMUM)
346 out_warning( "Old pv has an illegal move! ply=%d, move=%s",
347 ply, str_CSA_move(move) );
351 MakeMove( tt, move, ply );
354 #if ! defined(MINIMUM)
355 out_warning( "Old pv has an illegal evasion! ply=%d, move=%s",
356 ply, str_CSA_move(move) );
358 UnMakeMove( tt, move, ply );
363 for ( ply--; ply > 0; ply-- )
366 move = ptree->pv[0].a[ply];
367 UnMakeMove( tt, move, ply );
368 hash_store_pv( ptree, move, tt );
375 root_move_list[0].status = flag_first;
376 for ( i = 1; i < n; i++ ) { root_move_list[i].status = 0; }
379 /* a trial of searches */
381 value = searchr( ptree, root_alpha, root_beta, root_turn,
382 iteration_depth*PLY_INC + PLY_INC/2 );
383 if ( game_status & flag_search_error ) { return -1; }
384 if ( root_abort ) { break; }
386 assert( abs(value) < score_foul );
388 if ( root_beta <= value )
390 const char *str_move;
394 root_move_list[0].status &= ~flag_searched;
395 root_move_list[0].status |= flag_failhigh;
396 dvalue = (double)( root_turn ? -root_beta : root_beta );
398 do { root_beta = set_root_beta( ++root_nfail_high, root_beta ); }
399 while ( value >= root_beta );
401 str = str_time_symple( time_last_result - time_start );
402 if ( root_move_list[0].status & flag_first )
404 Out( "(%2d)%6s %7.2f ", iteration_depth, str, dvalue / 100.0 );
406 else { Out( " %6s %7.2f ", str, dvalue / 100.0 ); }
408 str = str_fail_high( root_turn, root_nfail_high );
410 MnjOut( "pid=%d move=%s v=%dl n=%" PRIu64 "\n", mnj_posi_id,
411 str_CSA_move(ptree->pv[1].a[1]), root_beta,
412 ptree->node_searched );
414 str_move = str_CSA_move_plus( ptree, ptree->pv[1].a[1], 1,
416 Out( " 1.%c%s [%s!]\n", ach_turn[root_turn], str_move, str );
419 if ( game_status & flag_pondering )
421 OutCsaShogi( "info%+.2f %c%s %c%s [%s!]\n",
422 dvalue / 100.0, ach_turn[Flip(root_turn)],
423 str_CSA_move(ponder_move),
424 ach_turn[root_turn], str_move, str );
427 OutCsaShogi( "info%+.2f %c%s [%s!]\n", dvalue / 100.0,
428 ach_turn[root_turn], str_move, str );
431 else if ( value <= root_alpha )
433 const char *str_move;
435 unsigned int time_elapsed;
438 if ( ! ( root_move_list[0].status & flag_first ) )
440 root_value = root_alpha;
444 root_move_list[0].status &= ~flag_searched;
445 root_move_list[0].status |= flag_faillow;
446 dvalue = (double)( root_turn ? -root_alpha : root_alpha );
448 if ( get_elapsed( &time_elapsed ) < 0 ) { return -1; }
450 do { root_alpha = set_root_alpha( ++root_nfail_low, root_alpha ); }
451 while ( value <= root_alpha );
452 root_value = root_alpha;
453 str = str_time_symple( time_elapsed - time_start );
454 Out( "(%2d)%6s %7.2f ", iteration_depth, str, dvalue / 100.0 );
456 str = str_fail_high( Flip(root_turn), root_nfail_low );
457 str_move = str_CSA_move_plus( ptree, root_move_list[0].move, 1,
459 Out( " 1.%c%s [%s?]\n", ach_turn[root_turn], str_move, str );
460 if ( game_status & flag_pondering )
462 OutCsaShogi( "info%+.2f %c%s %c%s [%s?]\n",
463 dvalue / 100.0, ach_turn[Flip(root_turn)],
464 str_CSA_move(ponder_move),
465 ach_turn[root_turn], str_move, str );
468 OutCsaShogi( "info%+.2f %c%s [%s?]\n", dvalue / 100.0,
469 ach_turn[root_turn], str_move, str );
475 /* the trial of search ended */
476 if ( root_alpha < root_value && root_value < root_beta )
478 last_root_value = root_turn ? - root_value : root_value;
479 last_pv = ptree->pv[0];
482 if ( root_abort ) { break; }
484 if ( root_alpha < root_value && root_value < root_beta )
486 #if ! defined(MINIMUM)
490 for ( i = 0; i < n; i++ )
492 if ( root_move_list[i].status & flag_searched ) { continue; }
493 out_warning( "A root move %s is ignored\n",
494 str_CSA_move(root_move_list[i].move) );
499 if ( ( game_status & flag_problem ) && depth_limit == PLY_MAX )
501 if ( is_answer_right( ptree->pv[0].a[1] ) )
503 if ( right_answer_made > 1 && iteration_depth > 3 ) { break; }
506 else { right_answer_made = 0; }
509 if ( abs(value) > score_max_eval ) { break; }
510 if ( iteration_depth >= depth_limit ) { break; }
512 root_beta = set_root_beta( 0, value );
513 root_alpha = set_root_alpha( 0, value );
514 root_value = root_alpha;
516 #if ! defined(MINIMUM)
517 else { out_warning(( "SEARCH INSTABILITY IS DETECTED!!!" )); }
522 root_move_t root_move_swap;
523 const int n = root_nmove;
527 for ( k = SHELL_H_LEN - 1; k >= 0; k-- )
530 for ( i = n-h-1; i > 0; i-- )
532 root_move_swap = root_move_list[i];
533 sortv = root_move_list[i].nodes;
534 for ( j = i+h; j < n && root_move_list[j].nodes > sortv; j += h )
536 root_move_list[j-h] = root_move_list[j];
538 root_move_list[j-h] = root_move_swap;
544 /* iteration ended */
545 sub_rejections( ptree, root_turn, 1 );
547 if ( game_status & flag_problem )
549 if ( is_answer_right( ptree->pv[0].a[1] ) )
551 right_answer_made = 1;
553 else { right_answer_made = 0; }
559 for ( i = 0; i < HIST_SIZE; i++ )
561 ptree->hist_good[i] /= 256U;
562 ptree->hist_tried[i] /= 256U;
565 /* prunings and extentions-statistics */
567 double drep, dreject, dhash, dnull, dfh1st;
569 drep = (double)ptree->nperpetual_check;
570 drep += (double)ptree->nfour_fold_rep;
571 drep += (double)ptree->nsuperior_rep;
572 drep *= 100.0 / (double)( ptree->nrep_tried + 1 );
574 dreject = 100.0 * (double)ptree->nreject_done;
575 dreject /= (double)( ptree->nreject_tried + 1 );
577 dhash = (double)ptree->ntrans_exact;
578 dhash += (double)ptree->ntrans_inferior_hit;
579 dhash += (double)ptree->ntrans_superior_hit;
580 dhash += (double)ptree->ntrans_upper;
581 dhash += (double)ptree->ntrans_lower;
582 dhash *= 100.0 / (double)( ptree->ntrans_probe + 1 );
584 dnull = 100.0 * (double)ptree->null_pruning_done;
585 dnull /= (double)( ptree->null_pruning_tried + 1 );
587 dfh1st = 100.0 * (double)ptree->fail_high_first;
588 dfh1st /= (double)( ptree->fail_high + 1 );
590 Out( " pruning -> rep=%4.2f%% reject=%4.2f%%\n", drep, dreject );
592 Out( " pruning -> hash=%2.0f%% null=%2.0f%% fh1st=%4.1f%%\n",
593 dhash, dnull, dfh1st );
595 Out( " extension-> chk=%u recap=%u 1rep=%u\n",
596 ptree->check_extension_done, ptree->recap_extension_done,
597 ptree->onerp_extension_done );
600 /* futility threashold */
601 #if ! ( defined(NO_STDOUT) && defined(NO_LOGGING) )
607 int misc_k = fmg_misc_king;
608 int cap_k = fmg_cap_king;
609 Out( " futility -> misc=%d drop=%d cap=%d mt=%d misc(k)=%d cap(k)=%d\n",
610 misc, drop, cap, mt, misc_k, cap_k );
614 /* hashing-statistics */
616 double dalways, dprefer, dsupe, dinfe;
617 double dlower, dupper, dsat;
619 int ntrans_table, i, n;
621 ntrans_table = 1 << log2_ntrans_table;
622 if ( ntrans_table > 8192 ) { ntrans_table = 8192; }
624 for ( i = 0, n = 0; i < ntrans_table; i++ )
626 word2 = ptrans_table[i].prefer.word2;
627 SignKey( word2, ptrans_table[i].prefer.word1 );
628 if ( trans_table_age == ( 7 & (int)word2 ) ) { n++; }
630 word2 = ptrans_table[i].always[0].word2;
631 SignKey( word2, ptrans_table[i].always[0].word1 );
632 if ( trans_table_age == ( 7 & (int)word2 ) ) { n++; }
634 word2 = ptrans_table[i].always[1].word2;
635 SignKey( word2, ptrans_table[i].always[1].word1 );
636 if ( trans_table_age == ( 7 & (int)word2 ) ) { n++; }
639 dalways = 100.0 * (double)ptree->ntrans_always_hit;
640 dalways /= (double)( ptree->ntrans_probe + 1 );
642 dprefer = 100.0 * (double)ptree->ntrans_prefer_hit;
643 dprefer /= (double)( ptree->ntrans_probe + 1 );
645 dsupe = 100.0 * (double)ptree->ntrans_superior_hit;
646 dsupe /= (double)( ptree->ntrans_probe + 1 );
648 dinfe = 100.0 * (double)ptree->ntrans_inferior_hit;
649 dinfe /= (double)( ptree->ntrans_probe + 1 );
651 Out( " hashing -> always=%2.0f%% prefer=%2.0f%% supe=%4.2f%% "
652 "infe=%4.2f%%\n", dalways, dprefer, dsupe, dinfe );
654 dlower = 100.0 * (double)ptree->ntrans_lower;
655 dlower /= (double)( ptree->ntrans_probe + 1 );
657 dupper = 100.0 * (double)ptree->ntrans_upper;
658 dupper /= (double)( ptree->ntrans_probe + 1 );
660 dsat = 100.0 * (double)n;
661 dsat /= (double)( 3 * ntrans_table );
663 OutCsaShogi( "statsatu=%.0f", dsat );
665 "exact=%d lower=%2.0f%% upper=%4.2f%% sat=%2.0f%% age=%d\n",
666 ptree->ntrans_exact, dlower, dupper, dsat, trans_table_age );
667 if ( dsat > 9.0 ) { trans_table_age = ( trans_table_age + 1 ) & 0x7; }
673 Out( " threading-> split=%d abort=%d slot=%d\n",
674 tlp_nsplit, tlp_nabort, tlp_nslot+1 );
675 if ( tlp_nslot+1 == TLP_NUM_WORK )
677 out_warning( "THREAD WORK AREA IS USED UP!!!" );
683 double dcpu_percent, dnps, dmat;
684 unsigned int cpu, elapsed;
686 Out( " n=%" PRIu64 " quies=%u eval=%u rep=%u %u(chk) %u(supe)\n",
687 ptree->node_searched, ptree->nquies_called, ptree->neval_called,
688 ptree->nfour_fold_rep, ptree->nperpetual_check,
689 ptree->nsuperior_rep );
691 if ( get_cputime( &cpu ) < 0 ) { return -1; }
692 if ( get_elapsed( &elapsed ) < 0 ) { return -1; }
695 elapsed -= time_start;
697 dcpu_percent = 100.0 * (double)cpu;
698 dcpu_percent /= (double)( elapsed + 1U );
700 dnps = 1000.0 * (double)ptree->node_searched;
701 dnps /= (double)( elapsed + 1U );
705 double n = (double)tlp_max;
706 node_per_second = (unsigned int)( ( dnps + 0.5 ) / n );
709 node_per_second = (unsigned int)( dnps + 0.5 );
712 dmat = (double)MATERIAL;
713 dmat /= (double)MT_CAP_PAWN;
715 OutCsaShogi( " cpu=%.0f nps=%.2f\n", dcpu_percent, dnps / 1e3 );
716 Out( " time=%s ", str_time_symple( elapsed ) );
717 Out( "cpu=%3.0f%% mat=%.1f nps=%.2fK", dcpu_percent, dmat, dnps / 1e3 );
718 Out( " time_eff=%s\n\n",
719 str_time_symple( time_last_eff_search - time_start ) );
722 if ( ( game_status & flag_problem ) && ! right_answer_made ) { iret = 0; }
732 unsigned int elapsed;
735 if ( time_limit < 150U ) { return 1; }
737 iret = all_hash_learn_store();
738 if ( iret < 0 ) { return iret; }
741 if ( get_elapsed( &elapsed ) < 0 ) { return -1; }
742 Out( "- load learnt hash values (%ss)\n",
743 str_time_symple( elapsed - time_start ) );
753 int misc, cap, drop, mt, misc_king, cap_king;
755 misc = fmg_misc - FMG_MG / 2;
756 cap = fmg_cap - FMG_MG / 2;
757 drop = fmg_drop - FMG_MG / 2;
758 misc_king = fmg_misc_king - FMG_MG_KING / 2;
759 cap_king = fmg_cap_king - FMG_MG_KING / 2;
760 mt = fmg_mt - FMG_MG_MT / 2;
762 fmg_misc = ( misc < FMG_MISC ) ? FMG_MISC : misc;
763 fmg_cap = ( cap < FMG_CAP ) ? FMG_CAP : cap;
764 fmg_drop = ( drop < FMG_DROP ) ? FMG_DROP : drop;
765 fmg_misc_king = ( misc_king < FMG_MISC_KING ) ? FMG_MISC_KING : misc_king;
766 fmg_cap_king = ( cap_king < FMG_CAP_KING ) ? FMG_CAP_KING : cap_king;
767 fmg_mt = ( mt < FMG_MT ) ? FMG_MT : mt;
772 set_root_beta( int nfail_high, int root_beta_old )
774 int aspiration_hwdth, aspiration_fail1;
776 if ( time_max_limit != time_limit )
778 aspiration_hwdth = MT_CAP_DRAGON / 8;
779 aspiration_fail1 = MT_CAP_DRAGON / 2;
782 aspiration_hwdth = MT_CAP_DRAGON / 4;
783 aspiration_fail1 = ( MT_CAP_DRAGON * 3 ) / 4;
786 switch ( nfail_high )
788 case 0: root_beta_old += aspiration_hwdth; break;
789 case 1: root_beta_old += aspiration_fail1 - aspiration_hwdth; break;
790 case 2: root_beta_old = score_bound; break;
792 out_error( "Error at set_root_beta!" );
795 if ( root_beta_old > score_max_eval ) { root_beta_old = score_bound; }
797 return root_beta_old;
802 set_root_alpha( int nfail_low, int root_alpha_old )
804 int aspiration_hwdth, aspiration_fail1;
806 if ( time_max_limit != time_limit )
808 aspiration_hwdth = MT_CAP_DRAGON / 8;
809 aspiration_fail1 = MT_CAP_DRAGON / 2;
812 aspiration_hwdth = MT_CAP_DRAGON / 4;
813 aspiration_fail1 = ( MT_CAP_DRAGON * 3 ) / 4;
818 case 0: root_alpha_old -= aspiration_hwdth; break;
819 case 1: root_alpha_old -= aspiration_fail1 - aspiration_hwdth; break;
820 case 2: root_alpha_old = -score_bound; break;
822 out_error( "Error at set_root_alpha!" );
825 if ( root_alpha_old < -score_max_eval ) { root_alpha_old = -score_bound; }
827 return root_alpha_old;
832 str_fail_high( int turn, int nfail_high )
836 if ( time_max_limit != time_limit )
838 if ( nfail_high == 1 ) { str = turn ? "-1" : "+1"; }
839 else { str = turn ? "-4" : "+4"; }
842 if ( nfail_high == 1 ) { str = turn ? "-2" : "+2"; }
843 else { str = turn ? "-6" : "+6"; }
850 is_answer_right( unsigned int move )
852 const char *str_anser;
853 const char *str_move;
857 str_move = str_CSA_move( move );
859 for ( ianser = 0; ianser < MAX_ANSWER; ianser++ )
861 str_anser = &( record_problems.info.str_move[ianser][0] );
862 if ( str_anser[0] == '\0' ) { break; }
863 if ( ! strcmp( str_anser+1, str_move ) )