本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · トーナメント表・表・決勝までの道を描く

judoOutcome関数

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

Checks a result against the rules and works out who won and how. winner is the winner the matchup names (needed for fusen-gachi and kiken-gachi, which no score can show). Throws a RangeError for a count out of range, two ippon, a method the scores contradict, or a default with no winner.

インポート

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

定義

function judoOutcome(result: JudoResult, winner?: 0 | 1 | null): JudoOutcome

引数

名前型説明
resultJudoResult

The scores and, optionally, the method, the golden score and the time.

winner (省略可)0 | 1 | null

Who won, when the scores do not say (a decision by the referees, a withdrawal): 0 or 1.

戻り値

JudoOutcome

The outcome: the winner (null when there is none yet), the method, the points, the time and whether golden score was played.

例

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

const o = judoOutcome({ sides: [{ yuko: 2 }, { wazaAri: 1, shido: 1 }], time: "4:00" });
console.log(o.winner, o.method, o.points.join(" "));
1 score 2 10

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

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

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