Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Calculation of chess tournament tiebreaks compliant with FIDE regulations
Tiebreak is a TypeScript library for calculating various tournament tiebreak scores. The focus lies on chess tournaments and implementing the algorithms specified by FIDE, the world chess organization.
Calculation of the following tiebreakers:
Configurable adjustments for unplayed games:
Built in calculation of entire tournament rankings
Note: Only individual Swiss tournaments are currently supported. Team tournaments and round robin tournaments are not implemented correctly yet.
npm install --save tiebreak
First, you need to create a Results
object with all relevant pairing information. You can use an arbitrary string or number to identify players.
import { Results, TournamentType } from "tiebreak"
const results = new Results(TournamentType.SWISS, [
{
// Example round 1: Player D did not show up
pairings: [
{ white: "C", black: "A", scoreWhite: 0.5, scoreBlack: 0.5, forfeited: false },
{ white: "B", black: "D", scoreWhite: 1, scoreBlack: 0, forfeited: true },
],
},
{
// Example round 2: Player D was not paired, player C received a bye
pairings: [{ white: "A", black: "B", scoreWhite: 0, scoreBlack: 1, forfeited: false }],
pairingAllocatedByes: ["C"],
},
])
You can now calculate a specific tiebreak score for a given player and round like this:
const tiebreaker = new Tiebreaker(results, UnplayedRoundsAdjustment.FIDE_2023)
console.log(tiebreaker.buchholz("A", 2))
// Output: 3.5
Or you can just calculate an entire ranking with multiple tiebreakers:
console.log(tiebreaker.ranking(2, [Tiebreak.SCORE, Tiebreak.BUCHHOLZ]))
/*
Output:
[
{ rank: 1, playerId: "B", scores: [2, 2.5] },
{ rank: 2, playerId: "C", scores: [1.5, 2] },
{ rank: 3, playerId: "A", scores: [0.5, 3.5] },
{ rank: 4, playerId: "D", scores: [0, 0] },
]
*/
See https://github.com/marceljuenemann/tiebreak/releases
npm run build
npm run test
or npm run test:watch
npm run test:coverage
(Not working yet?)npm run format
npm run lint
npm run spell:check
Deployment procedure:
npm run build
npm publish
FAQs
Calculation of chess tournament tiebreaks compliant with FIDE regulations
We found that tiebreak demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.