Reference · Native level collections
RopeCutEntrytype
A level and the cuts that win it, in order: the step to cut at, which rope, which link of it.
Import it
import type { RopeCutEntry } from "@johnmorrisdotca/karakuri/levels";
Definition
interface RopeCutEntry extends RopeLevel {
solution: readonly {
at: number;
rope: number;
link: number;
}[];
loss: readonly {
at: number;
rope: number;
link: number;
}[];
}
Members
| Name | Type | Description |
|---|---|---|
solution | readonly { at: number; rope: number; link: number; }[] | |
loss | readonly { at: number; rope: number; link: number; }[] | |
anchors | readonly { x: number; y: number; }[] | Where each rope is fixed. A rope runs from there to the load. |
load | { x: number; y: number; r: number; } | |
platforms | readonly Platform[] | |
goal | { kind: "zone" | "button"; area: Area; } | What wins: the load's centre in a |
pitY | number | Where the load is lost: below |
pits | readonly Area[] |
Examples
import type { RopeCutEntry } from "@johnmorrisdotca/karakuri/levels";
import { ROPE_CUT_LEVELS } from "@johnmorrisdotca/karakuri/levels";
const value: RopeCutEntry = ROPE_CUT_LEVELS[0];
console.log(value);{
anchors: [ { x: 180, y: 40 } ],
load: { x: 180, y: 170, r: 14 },
platforms: [
{ ax: 116, ay: 380, bx: 130, by: 440 },
{ ax: 130, ay: 440, bx: 230, by: 440 },
{ ax: 230, ay: 440, bx: 244, by: 380 }
],
goal: { kind: 'zone', area: { x: 135, y: 395, w: 90, h: 42 } },
pitY: 480,
pits: [],
solution: [ { at: 0, rope: 0, link: 4 } ],
loss: []
}What it prints (run when this page was built)