function current_table = fill_table (A) % this function finds the number of attacks % for each state where the queens can move [u v]=find(A); current_table = zeros(8); for i=1:8 temp1=1:8; f=find(A(:,i)~=0); temp1(f)=[]; for j=1:7 temp2=temp1(j); AA=A; AA(f,i)=0; AA(temp2,i)=1; current_table(temp2,i)=find_attacks(AA); end end for p=1:8 current_table(u(p),p)=100; % current_table(u,v)=100; end end