<>function [a,b]=aa<BR>i=1;<BR>for x1=1:8,<BR> for x2=1:8,<BR> if panduan([x1 x2]),<BR> continue;<BR> end<BR> for x3=1:8,<BR> if panduan([x1 x2 x3]),<BR> continue;<BR> end<BR> for x4=1:8,<BR> if panduan([x1 x2 x3 x4]),<BR> continue;<BR> end <BR> for x5=1:8,<BR> if panduan([x1 x2 x3 x4 x5]),<BR> continue;<BR> end<BR> for x6=1:8,<BR> if panduan([x1 x2 x3 x4 x5 x6]), <BR> continue;<BR> end<BR> for x7=1:8,<BR> if panduan([x1 x2 x3 x4 x5 x6 x7]), <BR> continue;<BR> end<BR> for x8=1:8,<BR> if panduan([x1 x2 x3 x4 x5 x6 x7 x8]), <BR> continue;<BR> end<BR> a(1,x1,i)=1;<BR> a(2,x2,i)=1;<BR> a(3,x3,i)=1;<BR> a(4,x4,i)=1;<BR> a(5,x5,i)=1;<BR> a(6,x6,i)=1;<BR> a(7,x7,i)=1;<BR> a(8,x8,i)=1;<BR> b(i,=[x1 x2 x3 x4 x5 x6 x7 x8];<BR> i=i+1;<BR> end<BR> end<BR> end<BR> end<BR> end<BR> end<BR> end<BR>end<BR></P>
<>function a=panduan(x)<BR>global ii<BR>l=length(x);<BR>b=x(end);<BR>c=x(1);<BR>ii=ii+1;<BR>if b==c|b==c+l-1|b==c-l+1,<BR> a=1;<BR>elseif l==2,<BR> a=0;<BR>else<BR> a=panduan(x(2:end));<BR>end</P>
<>一共92种</P> |