- if (token == "quit")
- {
- OpeningBook.close();
- stop_threads();
- quit_eval();
- exit(0);
- }
- else if (token == "uci")
- {
- std::cout << "id name " << engine_name() << std::endl;
- std::cout << "id author Tord Romstad" << std::endl;
- print_uci_options();
- std::cout << "uciok" << std::endl;
- }
- else if (token == "ucinewgame")
- {
- TT.clear();
- Position::init_piece_square_tables();
- RootPosition.from_fen(StartPosition);
- }
- else if (token == "isready")
- std::cout << "readyok" << std::endl;
- else if (token == "position")
- set_position(uip);
- else if (token == "setoption")
- set_option(uip);
- else if (token == "go")
- go(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.flipped_copy(p);
- }
- else if (token == "eval")
- {
- EvalInfo ei;
- std::cout << "Incremental mg: " << RootPosition.mg_value()
- << std::endl;
- std::cout << "Incremental eg: " << RootPosition.eg_value()
- << std::endl;
- std::cout << "Full eval: "
- << evaluate(RootPosition, ei, 0)
- << std::endl;
- }
- else if (token == "key")
- {
- std::cout << "key: " << RootPosition.get_key()
- << " material key: " << RootPosition.get_material_key()
- << " pawn key: " << RootPosition.get_pawn_key()
- << std::endl;
- }
- else
- {
- std::cout << "Unknown command: " << command << std::endl;
- while (!uip.eof())
- {
- uip >> token;
- std::cout << token << std::endl;
- }
- }
+ else if (token == "uci")
+ cout << "id name " << engine_name()
+ << "\nid author " << engine_authors()
+ << "\n" << Options.print_all()
+ << "\nuciok" << endl;
+ else
+ cout << "Unknown command: " << cmd << endl;