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JGD3VGLIK7JDABQ24E5SWN5CYRDGI6PIAFZ2BIMRDMANQC
TDHJSFFSJZBEZFMDHPLRSVB6CIVJ7AWGGNIC3WUCADQLQSIQKXDAC
move.source = @enumFromInt(Square, (in[0] - 'a' + (8 - (in[1] - '0')) * SIZE));
move.target = @enumFromInt(Square, (in[2] - 'a' + (8 - (in[3] - '0')) * SIZE));
move.source = @as(Square, @enumFromInt((in[0] - 'a' + (8 - (in[1] - '0')) * SIZE)));
move.target = @as(Square, @enumFromInt((in[2] - 'a' + (8 - (in[3] - '0')) * SIZE)));
const square = @intCast(SquareType, rank * SIZE + file);
const mask: usize = if (@bitCast(BoardType, self) & (@as(BoardType, 1) << square) != 0) 1 else 0;
const square = @as(SquareType, @intCast(rank * SIZE + file));
const mask: usize = if (@as(BoardType, @bitCast(self)) & (@as(BoardType, 1) << square) != 0) 1 else 0;
return @bitCast(BoardType, self.occupancies[@intFromEnum(Chess.Colors.white)]) |
@bitCast(BoardType, self.occupancies[@intFromEnum(Chess.Colors.black)]);
return @as(BoardType, @bitCast(self.occupancies[@intFromEnum(Chess.Colors.white)])) |
@as(BoardType, @bitCast(self.occupancies[@intFromEnum(Chess.Colors.black)]));
if (@bitCast(BoardType, bb) & (@as(BoardType, 1) << square) != 0) {
std.debug.print("{c} ", .{@enumFromInt(Chess.PE, idx).char()});
if (@as(BoardType, @bitCast(bb)) & (@as(BoardType, 1) << square) != 0) {
std.debug.print("{c} ", .{@as(Chess.PE, @enumFromInt(idx)).char()});
.white => @enumFromInt(Square, @intFromEnum(move.target) + 8),
.black => @enumFromInt(Square, @intFromEnum(move.target) - 8),
.white => @as(Square, @enumFromInt(@intFromEnum(move.target) + 8)),
.black => @as(Square, @enumFromInt(@intFromEnum(move.target) - 8)),
self.occupancies[@intFromEnum(Chess.Colors.white)] = @bitCast(BitBoard, white);
self.occupancies[@intFromEnum(Chess.Colors.black)] = @bitCast(BitBoard, black);
self.occupancies[@intFromEnum(Chess.Colors.white)] = @as(BitBoard, @bitCast(white));
self.occupancies[@intFromEnum(Chess.Colors.black)] = @as(BitBoard, @bitCast(black));
.white => @enumFromInt(Square, @ctz(
@bitCast(BoardType, self.bitboards[@intFromEnum(Chess.PE.K)]),
)),
.black => @enumFromInt(Square, @ctz(
@bitCast(BoardType, self.bitboards[@intFromEnum(Chess.PE.k)]),
)),
.white => @as(Square, @enumFromInt(@ctz(
@as(BoardType, @bitCast(self.bitboards[@intFromEnum(Chess.PE.K)])),
))),
.black => @as(Square, @enumFromInt(@ctz(
@as(BoardType, @bitCast(self.bitboards[@intFromEnum(Chess.PE.k)])),
))),
const rank = @intCast(isize, square.rank());
const file = @intCast(isize, square.file());
const rank = @as(isize, @intCast(square.rank()));
const file = @as(isize, @intCast(square.file()));