function A = move_one_queen(current_table,A,x,y,z) % This function determines which is the best move % from the current state, and moves one queen % to the next best position. % [x y z]=find_minimums(current_table); s=numel(x); s=randperm(s); s=s(1); x=x(s); y=y(s); p=find(A(:,y)==1); % T=A; A(x,y)=1; A(p,y)=0; % [u v]=find(T); % number_of_attacks=find_attacks(u,v); end