singleElimination関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The matchups of a single-elimination bracket for any number of teams, seeded in the standard way: the top seeds meet
the lowest first, and when the number is not a power of two the top seeds have byes. The teams are in seed order
(or carry a seed). No tie has a result yet; fill the results in and call advanceWinners to carry them forward.
インポート
import { singleElimination } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
function singleElimination(teams: readonly Team[], options?: SingleEliminationOptions): { teams: Team[]; matchups: Matchup[]; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
teams | readonly Team[] | The teams, best seed first. |
options (省略可) | SingleEliminationOptions | A third-place match, and a prefix for the ties' ids. |
戻り値
{ teams: Team[]; matchups: Matchup[]; }
The teams and the matchups, none played yet, ready for drawBracket.
例
import { singleElimination, drawBracket } from "@johnmorrisdotca/taisen-brackets";
const field = singleElimination([{ id: "A", name: "Aurora" }, { id: "B", name: "Harbour" }, { id: "C", name: "Cascade" }, { id: "D", name: "Delta" }]);
console.log(field.matchups.length, drawBracket(field).startsWith("<svg"));3 true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。