diff --git a/src/board/board.cpp b/src/board/board.cpp index 6eaf64d..9890ddd 100644 --- a/src/board/board.cpp +++ b/src/board/board.cpp @@ -526,20 +526,20 @@ void Board::print_squares_attacked(int att_side) const { int file = 0; int sq = 0; - printf("\n\nSquares attacked by:%c\n", sideChar[att_side]); + std::cout << "Squares attacked by " << sideChar[att_side] << std::endl; for(rank = RANK_8; rank >= RANK_1; --rank) { for(file = FILE_A; file <= FILE_H; ++file) { sq = FR2SQ(file,rank); if(sq_attacked(sq, att_side)) { - printf("X"); + std::cout << 'X'; } else { - printf("-"); + std::cout << '-'; } } - printf("\n"); + std::cout << std::endl; } - printf("\n\n"); + std::cout << std::endl << std::endl; } std::string Board::sq_to_str(const int sq) { diff --git a/src/io/uci.cpp b/src/io/uci.cpp index 9840d57..64864dd 100644 --- a/src/io/uci.cpp +++ b/src/io/uci.cpp @@ -115,8 +115,7 @@ void uci_parse_go(Board &board, std::istringstream is, SearchInfo &info) { info.depth = (depth == -1) ? MAX_DEPTH : depth; - printf("info string time:%d start:%lu stop:%lu depth:%d timeset:%d", - time,info.start_time,info.stop_time,info.depth,info.time_set); + std::cout << "info string time:" << time << " start:" << info.start_time << " stop:" << info.stop_time << " depth:" << info.depth << " timeset:" << info.time_set; std::cout << std::endl; std::thread (search, std::ref(board), std::ref(info)).detach(); diff --git a/src/move/move.cpp b/src/move/move.cpp index 14ad75c..34e4429 100644 --- a/src/move/move.cpp +++ b/src/move/move.cpp @@ -12,12 +12,12 @@ Move::Move() { move = 0; } -Move::Move(uint32_t m) { +Move::Move(int m) { move = m; } Move::Move(int from, int to, int cap, int pro, int f1) { - move = static_cast(from | (to << 7) | (cap << 14) | (pro << 20 | f1)); + move = from | (to << 7) | (cap << 14) | (pro << 20 | f1); } Move Move::from_str(const std::string &move_str, Board &board) { diff --git a/src/move/move.h b/src/move/move.h index 3e026e0..da4669a 100644 --- a/src/move/move.h +++ b/src/move/move.h @@ -26,7 +26,7 @@ class Board; class Move { public: Move(); - explicit Move(uint32_t m); + explicit Move(int m); Move(int from, int to, int cap, int pro, int f1); Move(const Move& rhs); diff --git a/src/search/search.cpp b/src/search/search.cpp index 7b71616..582340d 100644 --- a/src/search/search.cpp +++ b/src/search/search.cpp @@ -291,11 +291,9 @@ inline void search(Board& board, SearchInfo& info) { if(info.stopped) break; - printf("info score cp %d depth %d nodes %lu time %lu ", - best_score, current_depth, info.nodes, get_time()-info.start_time); - printf("pv"); + std::cout << "info score cp " << best_score << " depth " << current_depth << " nodes " << info.nodes << " time " << get_time()-info.start_time << " pv "; for(pv_num = 0; pv_num < pv_moves; pv_num++) { - printf(" %s", board.pvArray[pv_num].to_str().c_str()); + std::cout << " " << board.pvArray[pv_num].to_str(); } std::cout << std::endl;