- else if (token == "key") sync_cout << "position key: " << hex << pos.key()
- << "\nmaterial key: " << pos.material_key()
- << "\npawn key: " << pos.pawn_key()
- << sync_endl;
-
- else if (token == "uci") sync_cout << "id name " << engine_info(true)
- << "\n" << Options
- << "\nuciok" << sync_endl;
-
+ else if (token == "key")
+ sync_cout << hex << uppercase << setfill('0')
+ << "position key: " << setw(16) << pos.key()
+ << "\nmaterial key: " << setw(16) << pos.material_key()
+ << "\npawn key: " << setw(16) << pos.pawn_key()
+ << dec << sync_endl;
+
+ else if (token == "uci")
+ sync_cout << "id name " << engine_info(true)
+ << "\n" << Options
+ << "\nuciok" << sync_endl;
+
+ else if (token == "eval")
+ {
+ Search::RootColor = pos.side_to_move(); // Ensure it is set
+ sync_cout << Eval::trace(pos) << sync_endl;
+ }