The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

pair - Pair players for the next round of a swiss tournament

SYNOPSIS

pair

OPTIONS

--man A man page
--help This help message

DESCRIPTION

SCRIPTS

The scripts in script_files/ need to be installed somewhere so that they can be run in the directory in which pairing of each round is done.

DIRECTORY LAYOUT

The scripts assume that there is a directory in which a configuration file, called league.yaml, with data about the players exists. The rounds are paired in subdirectories, named 1,2,3,.. in this directory. Files named:

brackets.yaml pairing.yaml round.yaml matches.yaml player.yaml tourney.yaml

are left in these subdirectories after pairing. Don't delete these, as they are what allows data to be carried over from round to round.

Scores are in another subdirectory called scores. They are of the form 1.yaml, 2.yaml,..

DATA FILES

Do NOT use tabs in these YAML files. The level of indentation is significant. Follow the examples closely. The first, league.yaml has lines of the form:

member: - id: 1 name: Laver, Rod rating: 2810 - id: 2 name: Sampras, Pete rating: 2800 - id: 3 name: McEnroe, John rating: 2780

If you are using your own scoring scheme, and colors (called, roles), see the example in t/tennis in the distribution. You can add your own data to the member records. A pairing number is generated for the players, so don't add a pairing number.

The score files: 1.yaml, etc, are of the form:

 1: 1
 2: 1
 3: 0.5

The first number is the pairing number of the player. The second is the score.

Check the examples in t/tennis in the distribution.

GENERATING PAIRINGS

Starting with an empty main directory, create league.yaml, and an empty subdirectory for the first round. Run the script, 'pair' in the empty round subdirectory. A log of the pairing is printed and 'round.yaml' in the directory contains the matches. After the games in the round are complete, in the scores subdirectory, enter the scores for the players in the file, '1.yaml', or whatever the round is. Then you can run 'crosstable' or 'pairingtable' in the original directory above the subdirectory, to get current standings. If there is a next round, make another empty subdirectory, named after it and continue as before.