P1 P2 P3 P4 P5 P6 P1 1 2 3 4 5 P2 1 4 5 3 2 P3 2 4 1 5 3 P4 3 5 1 2 4 P5 4 3 5 2 1 P6 5 2 3 4 1 ##```## Rd 1: (P1,P2), (P3,P4), (P5, P6) Rd 2: (P1,P3), (P2,P6), (P4, P5) Rd 3: (P1,P4), (P2,P5), (P3, P6) Rd 4: (P1,P5), (P2,P3), (P4, P6) Rd 5: (P1,P6), (P2,P4), (P3, P5) ##``````## factorial[ ((n/2)-1) * (n-1) ] / [ factorial((n/2)-1) ]^(n-1) ##``````## Round 1: match 8 with 1, then pair up the rest symmetric to that line.. 1 | 7---|----2 8 6----------3 5----4 Round 2: match 8 with 2, then pair up the rest symmetric to the line.. 1 7 \ 2 \ \^ \ 8^ \ 6 \ 3 \ \ \ \ 5 4 Round X: ... keep rotating around the circle, etc ##``````## my @players = qw/Frodo Sam Merry Pippin Strider Gandalf Legolas Gimli/; ######## my \$num = @players; die "must have even number of players" if \$num % 2; for my \$partner (0 .. \$num-2) { print "Round #" . (\$partner + 1) . ":\n"; print " \$players[-1] vs \$players[\$partner]\n"; for my \$pair (1 .. (\$num-2)/2) { my \$p1 = (\$partner - \$pair) % (\$num - 1); my \$p2 = (\$partner + \$pair) % (\$num - 1); print " \$players[\$p1] vs \$players[\$p2]\n"; } } ```