本文へ移動

Taisen Brackets対戦

対戦の一覧から、トーナメント表をSVGで描きます。

対戦(たいせん)は、二者が向かい合って勝負することです。 名前について(英語)

目次

リファレンス · 各対戦の位置を計算

JudoOutcome型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A result checked and worked out.

インポート

import type { JudoOutcome } from "@johnmorrisdotca/taisen-brackets/layout";

ほかのエクスポート元: @johnmorrisdotca/taisen-brackets

定義

interface JudoOutcome {
    winner: 0 | 1 | null;
    method: JudoMethod | null;
    goldenScore: boolean;
    seconds: number | null;
    sides: readonly [
        Required<JudoSide>,
        Required<JudoSide>
    ];
    points: readonly [
        number,
        number
    ];
    doubleHansokuMake: boolean;
}

メンバー

名前型説明
winner0 | 1 | null

0 or 1, the side that won; null while nothing has decided it (level scores: golden score is next).

methodJudoMethod | null

How it was won, or null while undecided.

goldenScoreboolean
secondsnumber | null

The contest time in seconds, or null.

sidesreadonly [Required<JudoSide>, Required<JudoSide>]

The two sides with every count filled in.

pointsreadonly [number, number]

The value on the scoreboard (Articles 4 and 15: ippon 100, waza-ari 10, yuko 1; two waza-ari are ippon).

doubleHansokuMakeboolean

Both sides were given the third shido: the contest is recorded 0-0 and nobody wins (Article 18.3.1).

例

import { judoOutcome, type JudoOutcome } from "@johnmorrisdotca/taisen-brackets";

const outcome: JudoOutcome = judoOutcome({ sides: [{ yuko: 2 }, { wazaAri: 1, shido: 1 }], time: "4:00" });
console.log(outcome.winner, outcome.points, outcome.seconds);
1 [ 2, 10 ] 240

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/taisen-brackets 0.20.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。