0.1.0 • Published 1 month ago

@gaumala/swiss-rounds v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

swiss-rounds CircleCI

Swiss rounds algorithm for TCG events.

Usage

import * as swr from '@GAumala/swiss-rounds'

// first create the tournament with a list of participant names
const t1 = swr.createTournament([
  'alice',
  'bob',
  'charlie',
  'daniel',
])

// check current round matches:
t1.rounds[t1.rounds.length - 1]

// submit match results
const t2 = swr.submitScores(t1, 0, 3, 0)
const t3 = swr.submitScores(t2, 1, 0, 3)


// generate pairings for next round
const t4 = swr.computeNextRound(t3)

// submit match results
const t5 = swr.submitScores(t4, 0, 3, 0)
const t6 = swr.submitScores(t5, 1, 0, 3)

// print final placings list
swr.computePlacings(t6)

References

0.1.0

1 month ago