- if (token == "uci")
- {
- cout << "id name " << engine_name()
- << "\nid author Tord Romstad, Marco Costalba, Joona Kiiski\n";
- print_uci_options();
- cout << "uciok" << endl;
- }
- else if (token == "ucinewgame")
- {
- push_button("New Game");
- Position::init_piece_square_tables();
- RootPosition.from_fen(StartPositionFEN);
- }
- else if (token == "isready")
- cout << "readyok" << endl;
- else if (token == "position")
- set_position(uip);
- else if (token == "setoption")
- set_option(uip);
-
- // The remaining commands are for debugging purposes only.
- // Perhaps they should be removed later in order to reduce the
- // size of the program binary.
- else if (token == "d")
- RootPosition.print();
- else if (token == "flip")
- {
- Position p(RootPosition, RootPosition.thread());
- RootPosition.flipped_copy(p);
- }
- else if (token == "eval")
- {
- EvalInfo ei;
- cout << "Incremental mg: " << mg_value(RootPosition.value())
- << "\nIncremental eg: " << eg_value(RootPosition.value())
- << "\nFull eval: " << evaluate(RootPosition, ei) << endl;
- }
- else if (token == "key")
- cout << "key: " << hex << RootPosition.get_key()
- << "\nmaterial key: " << RootPosition.get_material_key()
- << "\npawn key: " << RootPosition.get_pawn_key() << endl;
- else if (token == "perft")
- perft(uip);
- else
- cout << "Unknown command: " << command << endl;