NAME

pairtable2yaml - Create YAML version of pairing table

SYNOPSIS

pairtable2yaml pairingtable.txt

Options:

--help This help message

--man A man page

DESCRIPTION

pairtable2yaml converts a pairing table used to pair the next round of a swiss tournament into a YAML data structure. It expects the pairing table, contained in a text file, to be formatted as a series of columns that represent a) scoregroups that players with equal scores fall into (optional), b) place so far (optional), c) pairing numbers, d) opponents each player has already met (each round's opponent being separated by a comma), e) the initial letters of the roles in the previous rounds (concatenated into one 'word'), f) downfloating/upfloating in the previous round (D/U) and in the round before the previous round (d/u) (an entry being made here only if the player floated), and g) the score of the player so far.

A typical pairing table looks like this:

                 Round 5 Pairing Groups
 ---------------------------------------------------------------------
 No  Opponents  Roles     Float Score
  1   6,4,2,5   WBWB      uD  3.5  
  2   7,3,1,4   BWBW      D   3.5  
  3   8,2,6,7   WBWB      d   2.5  
  6   1,5,3,9   BWBW          2.5  
                                  

In YAML, this becomes, or something the equivalent:

 ---
 opponents:
   1 : [6,4,2,5]
   2 : [7,3,1,4]
   3 : [8,2,6,7]
   6 : [1,5,3,9]
 roles:
   1 : [White,Black,White,Black]
   2 : [Black,White,Black,White]
   3 : [White,Black,White,Black]
   6 : [Black,White,Black,White]
 floats:
   1 : [Up,Down]
   2 : [~,Down]
   3 : [Down,~]
   6 : [~,~]
 score:
   1: 3.5
   2: 3.5
   3: 2.5
   6: 2.5
 ...

This program parses with Parse:RecDescent and is slow, but tries to make no mistakes.

The YAML data structure is dumped in pairtable.yaml in the same directory.