subroutine setup3(np,must,move) * ====== * Initialize the following arrays: * ------------------------------- integer np(3,6),must(27),move(27) integer num(3),no(3) * * ... Make all permutations: do 40 i=1,6 40 call permut(i,3,np(1,i)) * * ... Main loop: n=0 do 10 L=1,27 * ... Already covered: if(must(L).ne.0) goto 10 * ... Truly different: n=n+1 * * ... Split off digits: m=L-1 do 15 k=1,3 num(3-k+1)=mod(m,3) 15 m=m/3 * do 35 keer=1,2 * ... Permutations of digits: do 20 i=1,6 * ... The inverse: do 45 j=1,3 45 no(np(j,i))=j m=0 do 25 j=1,3 25 m=m*3+num(no(j)) m=m+1 * ... Assign new cases: if(must(m).eq.0) must(m)=n if(move(m).eq.0) move(m)=i 20 continue * * ... Exchange < and > : do 30 k=1,3 30 num(k)=mod(3-num(k),3) 35 continue * 10 continue * return end