Scripting Dynamics
c$=chr(10) n=0 loop: w$=arg(n) if err then goto exit: dim s1(len(w$)) gosub shuffle: count=0 s$="" FOR i=0 TO LEN(w$)-1 if mid(w$, i+1, 1)=s1(i) THEN count=count+1 s$=s$ & s1(i) NEXT PRINT w$ & " " & s$ & " " & count & c$ n=n+1 goto loop: exit: end shuffle: for i=0 to len(w$)-1 s1(i)=mid(w$, i+1, 1) next for i=0 TO len(w$)-1 FOR j=0 TO LEN(w$)-1 if i<>j AND s1(i)<>mid(w$, j+1 ,1) AND s1(j)<>mid(w$ ,i+1 ,1) then t$=s1(i) s1(i)=s1(j) s1(j)=t$ endif NEXT NEXT return