BTW, Howard, I've been through your permutation code, and found something's missing!
I extracted all but the code to generate the permutations and turned it into this independent script:
code:
BREAK ON
Dim $a, $b, $c, $d, $, $x, $y
$a = 'a'
$b = 'b'
$c = 'c'
$d = 'd'
for $y=1 to 4
for $x=1 to 4
? ""+$a+$b+$c+$d
$ = $b
$b = $c
$c = $d
$d = $
next
$ = $a
$a = $b
$b = $
next
I thought it would only do 16 of the 24 permutations, but it does even less!!
It only does 12 "diferent" permutations, as 4 are repeated!!
This means that you test only HALF the valid permutations!!!
code:
It. Permutation
01 abcd
02 acdb
03 adbc
04 abcd
05 cadb
06 cdba
07 cbad
08 cadb
09 dcba
10 dbac
11 dacb
12 dcba
13 bdac
14 bacd
15 bcda
16 bdac
Putting it another way, where the number(s) in front are
the iteration number(s) where that sequence is visited:
code:
abcd 01 04
abdc
acbd
acdb 02
adbc 03
adcb
bacd 14
badc
bcad
bcda 15
bdac 13 16
bdca
cabd
cadb 05 08
cbad 07
cbda
cdab
cdba 06
dabc
dacb 11
dbac 10
dbca
dcab
dcba 09 12
This means, or so I think, that you never test the
following permutations:
abdc acbd adcb badc bcad bdca cabd cbda cdab dabc dbca dcab
So, it's very likely that your code would fail on things like: 6143 and 6451.
[ 24. September 2002, 00:41: Message edited by: Fernando Madruga ]
_________________________
Later,
[b]Mad[/b]ruga