FindQuestion型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A "which one is this?" question: the place asked about, the choices (it among its look-alikes) and where it is in them.
インポート
import type { FindQuestion } from "@johnmorrisdotca/chizu";
定義
type FindQuestion = {
target: string;
choices: string[];
answerIndex: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
target | string | The code of the place asked about. |
choices | string[] | The codes to choose from, in an order a seed fixes, the target among them. |
answerIndex | number | Where in |
例
import WORLD from "@johnmorrisdotca/chizu/world";
import { findQuestion, seededRandom, type FindQuestion } from "@johnmorrisdotca/chizu";
const question: FindQuestion = findQuestion(WORLD, "FR", seededRandom(7))!;
console.log(question.choices[question.answerIndex]);
// FRFR出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。