Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

Reference · Framing, geometry and quiz tools

FindQuestiontype

A "which one is this?" question: the place asked about, the choices (it among its look-alikes) and where it is in them.

Import it

import type { FindQuestion } from "@johnmorrisdotca/chizu";

Definition

type FindQuestion = {
    target: string;
    choices: string[];
    answerIndex: number;
};

Members

NameTypeDescription
targetstring

The code of the place asked about.

choicesstring[]

The codes to choose from, in an order a seed fixes, the target among them.

answerIndexnumber

Where in choices the target is.

Examples

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]);
// FR
FR

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.