@@ -738,26 +738,22 @@ bool Board2::clr_board2(Board *board, ostream& os, vector<string> &p) {
738738 } else if (dot_demand (p, 3 , " print" , " move" , " list" )) {
739739 b.print_moves (cerr);
740740 } else if (dot_demand (p, 4 , " print" , " move" , " list" , (uintptr_t )1 )) {
741- b.print_moves (cerr, ILLEGAL_POS, ILLEGAL_POS,
742- PIECE_KIND[char_to_piece (parse_result[0 ][0 ])]);
741+ b.print_moves (cerr, ILLEGAL_POS, ILLEGAL_POS, PIECE_KIND[char_to_piece (p[3 ][0 ])]);
743742
744743 } else if (dot_demand (p, 4 , " print" , " moves" , " to" , (uintptr_t )2 )) {
745- b.print_moves (cerr, ILLEGAL_POS, strToPos (parse_result[ 0 ]));
744+ b.print_moves (cerr, ILLEGAL_POS, strToPos (p[ 3 ]));
746745 } else if (dot_demand (p, 5 , " print" , " moves" , " to" , (uintptr_t )2 , (uintptr_t )1 )) {
747- b.print_moves (cerr, ILLEGAL_POS, strToPos (parse_result[1 ]),
748- PIECE_KIND[char_to_piece (parse_result[1 ][0 ])]);
746+ b.print_moves (cerr, ILLEGAL_POS, strToPos (p[3 ]), PIECE_KIND[char_to_piece (p[4 ][0 ])]);
749747
750748 } else if (dot_demand (p, 4 , " print" , " moves" , " from" , (uintptr_t )2 )) {
751- b.print_moves (cerr, strToPos (parse_result[ 0 ]));
749+ b.print_moves (cerr, strToPos (p[ 3 ]));
752750 } else if (dot_demand (p, 5 , " print" , " moves" , " from" , (uintptr_t )2 , (uintptr_t )1 )) {
753- b.print_moves (cerr, strToPos (parse_result[0 ]), ILLEGAL_POS,
754- PIECE_KIND[char_to_piece (parse_result[1 ][0 ])]);
751+ b.print_moves (cerr, strToPos (p[3 ]), ILLEGAL_POS, PIECE_KIND[char_to_piece (p[4 ][0 ])]);
755752
756753 } else if (dot_demand (p, 6 , " print" , " moves" , " from" , " to" , (uintptr_t )2 , (uintptr_t )2 )) {
757- b.print_moves (cerr, strToPos (parse_result[ 0 ]), strToPos (parse_result[ 1 ]));
754+ b.print_moves (cerr, strToPos (p[ 4 ]), strToPos (p[ 5 ]));
758755 } else if (dot_demand (p, 7 , " print" , " moves" , " from" , " to" , (uintptr_t )2 , (uintptr_t )2 , (uintptr_t )1 )) {
759- b.print_moves (cerr, strToPos (parse_result[0 ]), strToPos (parse_result[1 ]),
760- PIECE_KIND[char_to_piece (parse_result[2 ][0 ])]);
756+ b.print_moves (cerr, strToPos (p[4 ]), strToPos (p[5 ]), PIECE_KIND[char_to_piece (p[6 ][0 ])]);
761757
762758 } else if (dot_demand (p, 3 , " print" , " bit" , " boards" )) {
763759 b.print_bit_boards (cerr);
@@ -777,16 +773,16 @@ bool Board2::clr_board2(Board *board, ostream& os, vector<string> &p) {
777773
778774 } else if (dot_demand (p, 3 , " retro" , " moves" , (uintptr_t )2 )) {
779775 vector<triple<Move,Undo,int > > rm = b.get_retro_moves (true , true , true , true );
780- os << " List of retro move(s) from current position with destination " << parse_result[ 0 ] << " \n " ;
776+ os << " List of retro move(s) from current position with destination " << p[ 2 ] << " \n " ;
781777 for (uint i=0 ; i<rm.size (); i++) {
782- if (POS_NAME[rm[i].first .to ] == parse_result[ 0 ])
778+ if (POS_NAME[rm[i].first .to ] == p[ 2 ])
783779 os << i << " :\t " << rm[i].first .toString2 () << " \t "
784780 << rm[i].third << " \t " << rm[i].second .toString () << " \n " ;
785781 }
786782
787783 } else if (dot_demand (p, 3 , " retro" , " move" , (uintptr_t )0 )) {
788784 vector<triple<Move,Undo,int > > rm = b.get_retro_moves (true , true , true , true );
789- uint n = atoi (parse_result[ 0 ].c_str ());
785+ uint n = atoi (p[ 2 ].c_str ());
790786 if (0 <=n && n<rm.size ()) {
791787 os << " Undoing retro move number " << n;
792788 if (rm[n].third ) {
@@ -1316,7 +1312,7 @@ bool Board2::find_legal_move(Move& move) {
13161312
13171313
13181314// triple<check_count, prev_num_checks, threat_pos>
1319- // Assume it is white-to-move and we wish to the possible last moves for black.
1315+ // Assume it is white-to-move and we wish to get the possible last moves for black.
13201316// check_count is the number of checks against whites king. After taking back one of
13211317// blacks moves it should be 0 - otherwise black could instead have captured whites king
13221318// - hence the position would be illegal.
@@ -1373,7 +1369,7 @@ triple<int,uint8_t,Position> Board2::retro_move_count_checks(Position from, Posi
13731369
13741370 check_count -= checktable (pattern, player);
13751371
1376- // Just or the 11 pattern of a blocking piece on top of board[to]
1372+ // Just or the 11b pattern of a blocking piece on top of board[to]
13771373 int line_index = d_to ? (to>>3 ) : (to&7 );
13781374 pattern |= DIAG_PATTERN[line_index][ 3 ];
13791375
@@ -1615,7 +1611,7 @@ triple<int,uint8_t,Position> Board2::retro_move_count_checks(Position from, Posi
16151611struct EnPassantPP {
16161612 EnPassantPP () : ep(ILLEGAL_POS), ep_pawn(0 ) {}
16171613
1618- // For the en passant at ep to be valid, the positions p1 and p2 may not be occupied
1614+ // For the en passant at ep to be valid, the positions p1 and p2 must not be occupied
16191615 EnPassantPP (Position p1, Position p2, Position ep) : ep(ep), ep_pawn(0 ) {
16201616 assert (p1<=ILLEGAL_POS && p2<=ILLEGAL_POS && ep<=ILLEGAL_POS);
16211617 illegal_from.set (p1);
0 commit comments