This matches pretty well what I would do manually: start with player 1, and assign her to the worst player. Then proceed with the second best, and assign it to the second worst etc.
In the next iteration the best is assigned to the second-worst, thereby decreasing the "distance" by one. At each step I take a look if the "best choice" player is free, and if not, skip to next free player
use strict;
use warnings;
# perl 5.10 only used for say() and infix //
use 5.010;
my $size = shift(@ARGV) // 6;
for my $turn (0.. ($size - 2)) {
my @players;
@players[0..($size-1)] = ((1) x $size);
for (0 .. ($size / 2 - 1)) {
my $current = $_;
$current = ($current + 1) % $size until $players[$current];
$players[$current] = 0;
my $other = ($size - $turn - $current - 1) % $size;
$other = ($other - 1) % $size until $players[$other];
$players[$other] = 0;
say $current + 1, '-', ($other + 1);
}
say '=' x 10;
}
It seems to work for size 6, haven't tested it for odd sizes.
Update: I've just re-check the output and found that it repeats some pairings. While that might be fixable with a hash of already-seen pairs, I won't bother because there's a more elegant, working solution given in another reply.