# roundrobin-tournament-js

> Easily schuedule tournaments using Round Robin algorithm

Latest version **1.2.0** (published 2022-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install roundrobin-tournament-js
pnpm add roundrobin-tournament-js
yarn add roundrobin-tournament-js
bun add roundrobin-tournament-js
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-09-08 |
| First published | 2022-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | EnrickyHip |
| Maintainers | enricky |

## Links

- npm: https://www.npmjs.com/package/roundrobin-tournament-js
- Repository: https://github.com/EnrickyHip/roundrobin-tournament-js
- Issues: https://github.com/EnrickyHip/roundrobin-tournament-js/issues
- npm.io page: https://npm.io/package/roundrobin-tournament-js

## Dependencies (1)

- [easy-shuffle](https://npm.io/package/easy-shuffle.md) ^1.0.1

## Recent versions

- 1.2.0 (latest) — 2022-09-08
- 1.1.4 — 2022-09-07
- 1.1.3 — 2022-09-07
- 1.1.2 — 2022-08-26
- 1.1.1 — 2022-08-01
- 1.1.0 — 2022-08-01
- 1.0.1 — 2022-07-30
- 1.0.0 — 2022-07-30

## README

# Round Robin Tournament
Easily schuedule tournaments using Round Robin algorithm. A Round Robin algorithm creates an "all-play-all" tournament, where every team plays against each other. (usually in two rounds, where each one is the home team once). Round Robin Tournament makes it automatically for you.

## Installation

```shell
$ npm install roundrobin-tournament-js
```

## Usage

To create a Round Robin Tournament you just need to create an array with any elements and pass it as a parameter to the roundrobin function.

```js
const roundrobin = require('roundrobin-tournament-js');

const teams = ["Liverpool", "Manchester United", "Arsenal", "Chelsea"];
const tournament = roundrobin(teams);

console.log(tournament);

/*
  output:

  [
    [ [ 'Liverpool', 'Chelsea' ], [ 'Manchester United', 'Arsenal' ] ],
    [ [ 'Chelsea', 'Manchester United' ], [ 'Arsenal', 'Liverpool' ] ],
    [ [ 'Arsenal', 'Chelsea' ], [ 'Liverpool', 'Manchester United' ] ]
  ]

*/
```
<br>

 auto-generate second rounds by setting to true the second parameter:

<br>

```js

const teams = ["Liverpool", "Manchester United", "Arsenal", "Chelsea"];
const tournament = roundrobin(teams, true);

console.log(tournament);

/*
  output:

  [
    [ [ 'Liverpool', 'Chelsea' ], [ 'Manchester United', 'Arsenal' ] ],
    [ [ 'Liverpool', 'Manchester United' ], [ 'Arsenal', 'Chelsea' ] ],
    [ [ 'Arsenal', 'Liverpool' ], [ 'Chelsea', 'Manchester United' ] ],
    [ [ 'Chelsea', 'Liverpool' ], [ 'Arsenal', 'Manchester United' ] ],
    [ [ 'Manchester United', 'Liverpool' ], [ 'Chelsea', 'Arsenal' ] ],
    [ [ 'Liverpool', 'Arsenal' ], [ 'Manchester United', 'Chelsea' ] ]
  ]

*/
```

## License

MIT License. Copyright (c) 2022

<br>

---
_Source: https://npm.io/package/roundrobin-tournament-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
