subroutine setup4(np,must,move) * ====== * Initialize the following arrays: * ------------------------------- integer np(4,24),must(81),move(81) integer num(4),no(4) * * ... Make all permutations: do 40 i=1,24 40 call permut(i,4,np(1,i)) * * ... Main loop: n=0 do 10 L=1,81 * ... Already covered: if(must(L).ne.0) goto 10 * ... Truly different: n=n+1 * * ... Split off digits: m=L-1 do 15 k=1,4 num(4-k+1)=mod(m,3) 15 m=m/3 * do 35 keer=1,2 * ... Permutations of digits: do 20 i=1,24 * ... The inverse: do 45 j=1,4 45 no(np(j,i))=j m=0 do 25 j=1,4 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,4 30 num(k)=mod(3-num(k),3) 35 continue * 10 continue * return end