Reference · Framing, geometry and quiz tools
Scorabletype
The parts of a place this scoring reads, so a map of your own places needs no more than these.
Import it
import type { Scorable } from "@johnmorrisdotca/chizu";
Definition
type Scorable = {
code: string | number;
group: string;
centroid: readonly [
number,
number
];
neighbors: ReadonlyArray<string | number>;
};
Members
| Name | Type | Description |
|---|---|---|
code | string | number | A code, text or a number: a map of your own places may key them by either, and neighbours are compared as text. |
group | string | |
centroid | readonly [number, number] | |
neighbors | readonly (string | number)[] |
Examples
import { distractorScore, type Scorable } from "@johnmorrisdotca/chizu";
const north: Scorable = { code: "N", group: "Island", centroid: [10, 10], neighbors: ["S"] };
const south: Scorable = { code: "S", group: "Island", centroid: [10, 60], neighbors: ["N"] };
console.log(distractorScore(north, south, 100) > 100);
// truetrueWhat it prints (run when this page was built)