File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ namespace Opening {
7676 return {" " , " " };
7777 }
7878
79- string sequence = strip (possible[Random::random ()% possible.size ()]);
79+ string sequence = strip (possible[Random::random () % possible.size ()]);
8080
8181 return {sequence, sequence.substr (moves.size (), 5 )};
8282 }
Original file line number Diff line number Diff line change @@ -183,11 +183,14 @@ int loop() {
183183 string cmd;
184184 Options options;
185185 Position pos = Bitboard::startpos ();
186- Opening::load_openings (options);
187186 vector<string> move_list = {};
188187 float prev_eval = 0 ;
189188 bool searching = false ;
190189
190+ if (options.OwnBook ) {
191+ Opening::load_openings (options);
192+ }
193+
191194 while (getline (cin, cmd)) {
192195 cmd = strip (cmd);
193196
@@ -231,9 +234,14 @@ int loop() {
231234 else if (name == " EvalKings" ) options.EvalKings = std::stof (value)/100 ;
232235
233236 else if (name == " OwnBook" ) {
234- if (value == " true" ) options.OwnBook = true ;
235- else if (value == " false" ) options.OwnBook = false ;
236- else std::cerr << " Unknown value: " << value << endl;
237+ if (value == " true" ) {
238+ options.OwnBook = true ;
239+ Opening::load_openings (options);
240+ } else if (value == " false" ) {
241+ options.OwnBook = false ;
242+ } else {
243+ std::cerr << " Unknown value: " << value << endl;
244+ }
237245 }
238246
239247 else if (name == " OwnBookPath" ) {
You can’t perform that action at this time.
0 commit comments