From 974af5d19f9d0b66aabb0779182d111a5d6db591 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 3 Feb 2025 19:09:21 +0100 Subject: [PATCH] we can now print a move (stockfish stile) --- cpp/src/move.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/src/move.hpp b/cpp/src/move.hpp index 7bb985d..b52f006 100644 --- a/cpp/src/move.hpp +++ b/cpp/src/move.hpp @@ -1,6 +1,7 @@ #pragma once #include "castle_side.hpp" +#include "coords.hpp" #include "pieces/piece.hpp" #include @@ -14,3 +15,9 @@ struct Move { bool en_passant = false; int8_t promoting_to = Piece::None; }; + +inline std::ostream& operator<<(std::ostream& os, const Move& m) { + os << Coords::from_index(m.source_square) + << Coords::from_index(m.target_square); + return os; +}