text
stringlengths 0
234
|
|---|
S.White_Queens_I:= White_Queens_I;
|
S.Black_Queens_I:= Black_Queens_I;
|
S.White_Kings_I:=White_Kings_I;
|
S.Black_Kings_I:=Black_Kings_I;
|
S.White_Pawns_I:=White_Pawns_I;
|
S.Black_Pawns_I:=Black_Pawns_I;
|
S.White_Pieces_I := White_Pieces_I;
|
S.Black_Pieces_I := Black_Pieces_I;
|
S.Z_I:=Z_I;
|
S.All_Pieces_45r_I := All_Pieces_45r_I ;
|
S.All_Pieces_45l_I := All_Pieces_45l_I ;
|
S.All_Pieces_90_I := All_Pieces_90_I ;
|
S.All_Pieces_I := All_Pieces_I ;
|
Function Definition: procedure Init_Masks is
|
Function Body: K,L:Integer;
|
begin
|
for I in 0..63 loop
|
Set_Mask_I(I):=Shift_Left (1,I);
|
end loop;
|
for I in 0..7 loop
|
for J in 0..7 loop
|
for N in 0..63 loop
|
Set_Mask_90_B(N)(8*I+J) := Set_Mask_B(N)(8*(7-J)+I);
|
end loop;
|
end loop;
|
end loop;
|
L:=0;
|
for I in 0 .. 14 loop
|
for J in 0..Integer'Min(7,I) loop
|
K:=I-J;
|
if K<=7 then
|
for N in 0..63 loop
|
Set_Mask_45l_B(N)(L) := Set_Mask_B(N)(J+K*8);
|
Set_Mask_45r_B(N)(L) := Set_Mask_B(N)(J*8+7-K);
|
end loop;
|
L:=L+1;
|
end if;
|
end loop;
|
end loop;
|
end Init_Masks;
|
function Is_In_Bounds(I,J:Integer) return Boolean is
|
begin
|
return((I<=7) and (I>=0) and (J<=7) and (J>=0));
|
end Is_In_Bounds;
|
procedure Init_Knight_Attacks is
|
Knight_Moves : array (0..7,0..1) of Integer := ((1,2),(2,1),(-1,2),(-2,1),(1,-2),(2,-1),(-1,-2),(-2,-1));
|
begin
|
for I in 0..63 loop
|
Knight_Attacks_I(I) := 0;
|
Knight_Mobility(I) := 0;
|
end loop;
|
for I in 0..7 loop
|
for J in 0..7 loop
|
for K in 0..7 loop
|
if Is_In_Bounds(I+Knight_Moves(K,0),J+Knight_Moves(K,1)) then
|
Knight_Attacks_B(I*8+J)((I+Knight_Moves(K,0))*8+J+Knight_Moves(K,1)) := 1;
|
Knight_Mobility(I*8+J):=Knight_Mobility(I*8+J)+1;
|
end if;
|
end loop;
|
end loop;
|
end loop;
|
end Init_Knight_Attacks;
|
procedure Init_King_Attacks is
|
King_Moves : array (0..7,0..1) of Integer := ((1,1),(1,0),(1,-1),(0,1),(0,-1),(-1,1),(-1,0),(-1,-1));
|
begin
|
for I in 0..63 loop
|
King_Attacks_I(I) := 0;
|
end loop;
|
for I in 0..7 loop
|
for J in 0..7 loop
|
for K in 0..7 loop
|
if Is_In_Bounds(I+King_Moves(K,0),J+King_Moves(K,1)) then
|
King_Attacks_B(I*8+J)((I+King_Moves(K,0))*8+J+King_Moves(K,1)) := 1; end if;
|
end loop;
|
end loop;
|
end loop;
|
end Init_King_Attacks;
|
procedure Init_White_Pawn_Attacks is
|
Pawn_Inc : array (0..1,0..1) of Integer := ((1,1),(1,-1));
|
I : Integer :=0;
|
J : Integer :=0;
|
begin
|
for I in 0..63 loop
|
White_Pawn_Attacks_I(I):=0;
|
end loop;
|
for I in 0..7 loop
|
for J in 0..7 loop
|
for K in 0..1 loop
|
if Is_In_Bounds(I+Pawn_Inc(K,0),J+Pawn_Inc(K,1)) then
|
White_Pawn_Attacks_B(I*8+J)((I+Pawn_Inc(K,0))*8+J+Pawn_Inc(K,1)) := 1;
|
end if;
|
end loop;
|
end loop;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.