JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 128
  • Score
    100M100P100Q84719F
  • License MIT

Koya tiebreak system for round-robin chess tournaments following FIDE rules. Zero dependencies.

Package Exports

  • @echecs/koya

Readme

Koya

npm Test Coverage License: MIT

Koya is a TypeScript library implementing the Koya tiebreak system for round-robin chess tournaments, following the FIDE Tiebreak Regulations (section 9.2). Zero runtime dependencies.

Installation

npm install @echecs/koya

Quick Start

import { koya } from '@echecs/koya';

const games = [
  { blackId: 'B', result: 1, round: 1, whiteId: 'A' },
  { blackId: 'C', result: 0.5, round: 2, whiteId: 'A' },
  { blackId: 'A', result: 0, round: 3, whiteId: 'D' },
];

const score = koya('A', games);
// Returns points scored against opponents who achieved >= 50% of the maximum score

API

koya(playerId, games)

FIDE section 9.2 — Koya score. Returns the total points scored by playerId only in games played against opponents who achieved at least 50% of the maximum possible score in the tournament. Designed for round-robin (all-play-all) tournaments. Byes are excluded from both the threshold calculation and the score sum.

koya(playerId: string, games: Game[]): number

Drop-in compatible with the shared Tiebreak type (playerId: string, games: Game[], players: Player[]) => number.

Contributing

Contributions are welcome. Please open an issue at github.com/mormubis/koya/issues.