NCFUC2F34HIV6BZYYMMHIGQOD6G6BUJZYY4RINPCAKGCSVCC46DAC
XRCSCQWQKVYASIMAJO7JVUJXHXE44FZROCJPBW2BR7EE4RPEIBKAC
RNEXG5IFDKMHSUR6RMNTI3Y32ORLVMZ6UJYKHLV2XBMT2QONBTVQC
X3FYJUNL5ORLRC7TW3C5OMNZOX4JEWL73RXOQZLRKLAUBVNARIMAC
FRUDIRWXGFOZERET3DNUNAZ5HSA3G32JZX6WMIXNGZOACTTCRIQAC
A46B5KNQFPTZEIL2JZKD2CQELGU3COE6FGTV2ABS5U7DVTVDGEBQC
FOORIA7SEZCLKDBNMV6KEDTQOJJVAH57BQFBRSQMET6FERJPHCVQC
TB4YBE4CMWCLSKJ43QF6IU5HVYUUO33BLXVG7XDRLJS3IFIBQLYAC
2CU67A3QXXPH722WBAL74O6P2N2RRXFBQVPT3A5QAXTUCQ3UUU5AC
std.debug.print("info score cp {d} depth {d} nodes: {d} ", .{ scr, depth, nodes });
var ret = std.ArrayList(u8).init(gs.allocator);
defer ret.deinit();
const info = try std.fmt.allocPrint(
gs.allocator,
"info score cp {d} depth {d} nodes {d} pv ",
.{ scr, depth, nodes },
);
try ret.appendSlice(info);
std.debug.print("\n", .{});
const bestmove = try std.fmt.allocPrint(gs.allocator, "bestmove {s}{s}{s}\n", .{
@tagName(pv_table[0][0].source),
@tagName(pv_table[0][0].target),
if (pv_table[0][0].prom != .none) @tagName(pv_table[0][0].prom) else "",
});
try ret.appendSlice(bestmove);
if (@bitCast(BitMoveType, pv_table[0][0]) != 0) {
return std.fmt.bufPrint(&buf, "bestmove {s}{s}{s}\n", .{
@tagName(pv_table[0][0].source),
@tagName(pv_table[0][0].target),
if (pv_table[0][0].prom != .none) @tagName(pv_table[0][0].prom) else "",
}) catch unreachable;
} else return "";
return try ret.toOwnedSlice();