@@ -156,10 +156,6 @@ extern const string game_status_texts[7];
156156#define DB_ARRAY_LENGTH (3 *DB_BQUEEN_VALUE+1 )
157157extern const int ENDGAME_HASHING_CONSTANTS[13 ];
158158
159- // Nothing may evaluate to more/less than +/-WIN
160- #define INF 0x7FFFFFFF
161- #define WIN 0x003FFFFF
162-
163159extern const uint PIECE_COUNT_CONSTANTS[13 ];
164160extern const uint ENDGAME_HASHING_INSUFFICIENT_MATERIAL_CONSTANTS[13 ][2 ];
165161
@@ -250,11 +246,11 @@ void print_map64(ostream &os, TYPE *list64, int num_digits=0, int base=10) {
250246template <class TYPE >
251247void print_latex_map64 (ostream &os, TYPE *list64, int num_digits=0 , int base=10 ) {
252248 os << " {\\ setlength\\ tabcolsep{0.7\\ tabcolsep}\n "
253- << " \\ begin{footnotesize}\n "
254- << " \\ begin{center}\n "
255- << " \\ begin{tabular}{c|cccccccc|c}\n "
256- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
257- << " \\ cline{2-9}\n " ;
249+ << " \\ begin{footnotesize}\n "
250+ << " \\ begin{center}\n "
251+ << " \\ begin{tabular}{c|cccccccc|c}\n "
252+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
253+ << " \\ cline{2-9}\n " ;
258254
259255 for (int r=7 ; r>=0 ; r--) {
260256 os << (r+1 ) << " & " ;
@@ -266,11 +262,11 @@ void print_latex_map64(ostream &os, TYPE *list64, int num_digits=0, int base=10)
266262 }
267263
268264 os << " \\ cline{2-9}\n "
269- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
270- << " \\ end{tabular}\n "
271- << " \\ end{center}\n "
272- << " \\ end{footnotesize}\n "
273- << " }\n " ;
265+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
266+ << " \\ end{tabular}\n "
267+ << " \\ end{center}\n "
268+ << " \\ end{footnotesize}\n "
269+ << " }\n " ;
274270}
275271
276272// TYPE is signed value
@@ -309,11 +305,11 @@ void print_signed_map64(OSTREAM &os, TYPE *list64, int num_digits=0, int base=10
309305template <class TYPE >
310306void print_latex_signed_map64 (ostream &os, TYPE *list64, int num_digits=0 , int base=10 ) {
311307 os << " {\\ setlength\\ tabcolsep{0.7\\ tabcolsep}\n "
312- << " \\ begin{footnotesize}\n "
313- << " \\ begin{center}\n "
314- << " \\ begin{tabular}{c|cccccccc|c}\n "
315- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
316- << " \\ cline{2-9}\n " ;
308+ << " \\ begin{footnotesize}\n "
309+ << " \\ begin{center}\n "
310+ << " \\ begin{tabular}{c|cccccccc|c}\n "
311+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
312+ << " \\ cline{2-9}\n " ;
317313
318314 for (int r=7 ; r>=0 ; r--) {
319315 os << (r+1 ) << " & " ;
@@ -325,11 +321,11 @@ void print_latex_signed_map64(ostream &os, TYPE *list64, int num_digits=0, int b
325321 }
326322
327323 os << " \\ cline{2-9}\n "
328- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
329- << " \\ end{tabular}\n "
330- << " \\ end{center}\n "
331- << " \\ end{footnotesize}\n "
332- << " }\n " ;
324+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
325+ << " \\ end{tabular}\n "
326+ << " \\ end{center}\n "
327+ << " \\ end{footnotesize}\n "
328+ << " }\n " ;
333329}
334330
335331// TYPE is signed value
@@ -350,12 +346,12 @@ void print_string_map64(ostream &os, TYPE *list64, int padded_length) {
350346 os << (r+1 ) << " |" ;
351347 for (int c=0 ; c<8 ; c++) {
352348 for (int i=list64[8 *r+c].size (); i<=padded_length; i++)
353- os << ' ' ;
349+ os << ' ' ;
354350 os << list64[8 *r+c];
355351 }
356352 os << " | " << (r+1 ) << ' \n ' ;
357353 }
358-
354+
359355 os << " +" ;
360356 for (int i=0 ; i<=padded_length; i++) os << " --------" ;
361357 os << " -+\n " ;
@@ -371,29 +367,29 @@ void print_string_map64(ostream &os, TYPE *list64, int padded_length) {
371367template <class TYPE >
372368void print_latex_string_map64 (ostream &os, TYPE *list64, int padded_length) {
373369 os << " {\\ setlength\\ tabcolsep{0.7\\ tabcolsep}\n "
374- << " \\ begin{footnotesize}\n "
375- << " \\ begin{center}\n "
376- << " \\ begin{tabular}{c|cccccccc|c}\n "
377- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
378- << " \\ cline{2-9}\n " ;
370+ << " \\ begin{footnotesize}\n "
371+ << " \\ begin{center}\n "
372+ << " \\ begin{tabular}{c|cccccccc|c}\n "
373+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
374+ << " \\ cline{2-9}\n " ;
379375
380376 for (int r=7 ; r>=0 ; r--) {
381377 os << (r+1 ) << " & " ;
382378 for (int c=0 ; c<8 ; c++) {
383379 if (c) os << ' &' ;
384380 for (int i=list64[8 *r+c].size (); i<padded_length; i++)
385- os << ' ' ;
381+ os << ' ' ;
386382 os << list64[8 *r+c];
387383 }
388384 os << " & " << (r+1 ) << " \\\\\n " ;
389385 }
390386
391387 os << " \\ cline{2-9}\n "
392- << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
393- << " \\ end{tabular}\n "
394- << " \\ end{center}\n "
395- << " \\ end{footnotesize}\n "
396- << " }\n " ;
388+ << " \\ multicolumn{1}{c}{}& a& b& c& d& e& f& g&\\ multicolumn{1}{c}{h}\\\\\n "
389+ << " \\ end{tabular}\n "
390+ << " \\ end{center}\n "
391+ << " \\ end{footnotesize}\n "
392+ << " }\n " ;
397393}
398394
399395// ################################
@@ -434,8 +430,8 @@ public:
434430 // If so, piece_list, _castling and _en_passant are updated accordingly.
435431 // piece_list might be changed if piece overlap encodes castling
436432 bool set_board (vector<PiecePos> &piece_list, int player_turn,
437- int &_castling, int &_en_passant,// use 0, ILLEGAL_POS as default
438- int _moves_played_since_progress = 0 , int full_move_number = 50 );
433+ int &_castling, int &_en_passant,// use 0, ILLEGAL_POS as default
434+ int _moves_played_since_progress = 0 , int full_move_number = 50 );
439435 bool set_board (vector<PiecePos> &piece_list, int player_turn) {
440436 int _castling = 0 ;
441437 int _en_passant = ILLEGAL_POS;
@@ -447,15 +443,17 @@ public:
447443 int index = 0 ;
448444 for (int i=0 ; i<64 ; i++)
449445 if (board[i]) {
450- assert ((uint)index < l.size ());
451- l[index++] = PiecePos (board[i], i);
446+ assert ((uint)index < l.size ());
447+ l[index++] = PiecePos (board[i], i);
452448 }
453449 assert ((uint)index == l.size ());
454450 }
455- // get_encoded_piece_list encodes en passant and castling in the position of the pieces
456- // (castling only encoded if ENDGAME_TABLE_WITH_CASTLING==1)
457- void get_encoded_piece_list (vector<PiecePos> &l) const ;
458451
452+ /* *
453+ * get_encoded_piece_list encodes en passant and castling in the position of the pieces
454+ * (castling only encoded if ENDGAME_TABLE_WITH_CASTLING==1)
455+ */
456+ void get_encoded_piece_list (vector<PiecePos> &l) const ;
459457
460458 // returns b7b6b5b4b3b2b1b0. bi is 1 iff transformation i is legal
461459 uchar allowed_symmetries () {
@@ -503,8 +501,8 @@ public:
503501 }
504502 uchar get_num_pawns () const {
505503 return get_num_pieces () - 2 -
506- (piece_count.individual .num_non_zugzwang_pieces & 0xF ) -
507- (piece_count.individual .num_non_zugzwang_pieces >> 4 );
504+ (piece_count.individual .num_non_zugzwang_pieces & 0xF ) -
505+ (piece_count.individual .num_non_zugzwang_pieces >> 4 );
508506 }
509507
510508 bool get_insufficient_material_a () const {
@@ -521,7 +519,7 @@ public:
521519 }
522520
523521 int get_moves_played () { return moves_played; }
524-
522+
525523 bool played_from_scratch;
526524 string initial_position;
527525
@@ -585,23 +583,6 @@ protected:
585583 // In half-moves. Eg. in move 5.b moves_played is 2*(5-1)+1
586584 int moves_played;
587585
588- /*
589- // Keep track of the number of each type of pieces
590- uchar piece_count[13];
591-
592- // Returns true if the numbers of pieces can be reached from the initial position.
593- // Ie. max 15 pieces (not counting king). 6 rooks and 6 queens not possible.
594- bool valid_piece_count(bool player) {
595- if (player) {
596- return 15 >= max(0, piece_count[BKNIGHT]-2) + max(0, piece_count[BBISHOP]-2)
597- + max(0, piece_count[BROOK]-2) + max(0, piece_count[BQUEEN]-1) + piece_count[BPAWN];
598- } else {
599- return 15 >= max(0, piece_count[WKNIGHT]-2) + max(0, piece_count[WBISHOP]-2)
600- + max(0, piece_count[WROOK]-2) + max(0, piece_count[WQUEEN]-1) + piece_count[WPAWN];
601- }
602- }
603- */
604-
605586 union {
606587 struct {
607588 // WARNING: big-little endian dependent code
0 commit comments