WSRRWTTVBE2K6NKPS54CXMY3QYK5YTDRGEH3YJ53VQ2XW5UM5O2QC
THYIOCFC72V4ZMTLMGRGRIBARXT2LPSQCL2XNOIBI22QRVYUMIYQC
DKK2G2S3X7KFEJBHGLUEVTBBW6UBR36XR7ZBUWG5GO6JYXWGJOOAC
FOORIA7SEZCLKDBNMV6KEDTQOJJVAH57BQFBRSQMET6FERJPHCVQC
BL3ZR4OWJM54HFXUNMUZKB5YQYVBT7ETFIXCOXWL6S5SZFM6IFDQC
TB4YBE4CMWCLSKJ43QF6IU5HVYUUO33BLXVG7XDRLJS3IFIBQLYAC
NYVHTMLLUMBKBQSWO6SQDQ5KFACQLNCBRDDM5BH3OU6WWT54KC2AC
return std.fmt.bufPrint(&buf, "bestmove {s}{s}{s}\n", .{
@tagName(self.best_move.source),
@tagName(self.best_move.target),
if (self.best_move.prom != .none) @tagName(self.best_move.prom) else "",
}) catch unreachable;
std.debug.print("info score cp {d} depth {d}\n", .{ score, depth });
if (@bitCast(BitMoveType, self.best_move) != 0) {
return std.fmt.bufPrint(&buf, "bestmove {s}{s}{s}\n", .{
@tagName(self.best_move.source),
@tagName(self.best_move.target),
if (self.best_move.prom != .none) @tagName(self.best_move.prom) else "",
}) catch unreachable;
} else return "";
var best_sofar: BitMove = undefined;
const king = switch (self.side) {
.white => @intCast(SquareType, @ctz(@bitCast(BoardType, self.bitboards[@enumToInt(Chess.PE.K)]))),
.black => @intCast(SquareType, @ctz(@bitCast(BoardType, self.bitboards[@enumToInt(Chess.PE.k)]))),
};
var in_check = self.isSquareAttacked(king, self.side.enemy());
var legal_moves: usize = 0;