File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 11use std:: process:: exit;
22
3- use chess:: { definitions:: NumberOf , pieces:: PIECE_NAMES } ;
3+ use chess:: {
4+ definitions:: NumberOf ,
5+ pieces:: { ALL_PIECES , PIECE_NAMES } ,
6+ } ;
47use clap:: Parser ;
58use indicatif:: ParallelProgressIterator ;
69use parameters:: Parameters ;
@@ -52,11 +55,12 @@ fn print_params(params: &Parameters) {
5255 println ! ( "Tuned parameters:" ) ;
5356 println ! ( "=================" ) ;
5457 println ! ( "pub const PSQTS : [[PhasedScore; NumberOf::SQUARES]; NumberOf::PIECE_TYPES] = [" ) ;
55- for i in ( 0 ..params . len ( ) ) . step_by ( NumberOf :: SQUARES ) {
56- println ! ( " // {}" , PIECE_NAMES [ i / ( NumberOf :: SQUARES ) ] ) ;
58+ for piece in ALL_PIECES {
59+ println ! ( " // {}" , PIECE_NAMES [ piece as usize ] ) ;
5760 println ! ( " [" ) ;
58-
59- let table = & params. as_slice ( ) [ i..i + NumberOf :: SQUARES ] ;
61+ let start_idx = piece as usize * NumberOf :: SQUARES ;
62+ let end_index = start_idx + NumberOf :: SQUARES ;
63+ let table = & params. as_slice ( ) [ start_idx..end_index] ;
6064 print_table ( 8 , table) ;
6165 println ! ( " ]," ) ;
6266 }
You can’t perform that action at this time.
0 commit comments