Found it on my old site:
rrpair.c. IMHO it would be worthwhile to study how the JavaScript version works than to use this old
C program. Other than the loss of pointers, I found it fairly easy to pick up JavaScript after a
C background.
The site I gave in the first post has links to other pages showing how a RR works. For a (for example) a 12 person (team) RR, player 12 sits on his own card table near the end of a loooong table where the rest of the chess sets are ready to go. Assuming a "ribbon" of players (will have an odd number), 1 starts with White on 12's card table while the rest of the players are seated in order in every other position. If done correctly, the pairings are 1-12, 11-2, 10-3, 9-4, etc. With the exception of 12, add 1 to each player's current opponent to get the next one (1 follows 11). When one's own number is reached, play 12 on the card table.
The color assignments (or home/away status) are fixed at every position except on the card table. The player here is
the ghost since he won't exist if there are an odd number of players.