to

tournament-organizer

JavaScript library for running tournaments

Showing:

Popularity

Downloads/wk

92

GitHub Stars

9

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Tournament Organizer

A zero dependency module for organizing tournaments

npm GitHub last commit GitHub issues GitHub pull requests GitHub Ko-Fi

About

This JavaScript module for Node.js facilitates the organization and execution of tournaments.

Tournaments can be paired by single elimination, double elimination, round-robin, double round-robin, Swiss, and Dutch.

If round-robin, double round-robin, Swiss, or Dutch are chosen, then a single elimination or double elimination playoffs can follow.

For Swiss, Dutch, and round-robin tournaments, the following tiebreakers systems are supported:

  • Buchholz Cut 1
  • Solkoff (Buchholz)
  • Median-Buchholz
  • Sonneborn-Berger (Neustadtl)
  • Cumulative (and Cumulative Opponent's)
  • Versus
  • Magic TCG
    • Opponent's match win percentage
    • Game win percentage
    • Opponent's game win percentage
  • Pokemon TCG
    • Opponent's match win percentage
    • Opponent's opponent's match win percentage

A Couple Details

For double elimination, the method in which players move to the loser's bracket follows the same four alternating orders as explained here.

For round-robin (and double round-robin), players are paired via Berger Tables.

For Swiss and Dutch, the pairing algorithms are created to be fast and efficient, but not perfect. Both formats guarantee that players can not play each other multiple times. The Dutch algorithm ensures players can not have a color preference of +/- 3 or play as the same color 3 times in a row (under the assumption that Dutch tournaments are chess tournaments).

Installation

npm install tournament-organizer

Basic Usage

const TournamentOrganizer = require('tournament-organizer');

// Create an event manager

const manager = new TournamentOrganizer.EventManager();

// Create a tournament
// First parameter can be set to a custom ID
// More options are available to set

const tourney = manager.createTournament(null, {
    name: 'My Example Tournament',
    format: 'swiss',
    playoffs: 'elim',
    cutLimit: 8,
    bestOf: 3,
    winValue: 3,
    drawValue: 1,
    tiebreakers: ['magic-tcg']
});

// Add players

tourney.addPlayer('Liam S');
tourney.addPlayer('Emma P.');
tourney.addPlayer('Noah B.');
tourney.addPlayer('Sophia R.');
// As many as desired

// Start the tournament

tourney.startEvent();

// Get all active matches

const active = tourney.activeMatches();

// Record a result

tourney.result(active[0], 2, 1);

// Get standings

const standings = tourney.standings();

Implementations

  • Bracketeer - A Discord bot that runs tournaments

Contributing

Please submit an issue if you encounter a bug or have a feature suggestion.

If you are interested, please feel free to fork and clone the repository (on main branch), then submit a pull request.

I am a high school teacher, and would appreciate any and all support in continuing this project.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100