Reference · Native level collections
PinRescueEntrytype
A level, the pins that win it in order (by index in pins), and pins that lose it in order.
Import it
import type { PinRescueEntry } from "@johnmorrisdotca/karakuri/levels";
Definition
interface PinRescueEntry extends PinLevel {
solution: readonly number[];
loss: readonly number[];
}
Members
| Name | Type | Description |
|---|---|---|
solution | readonly number[] | |
loss | readonly number[] | |
walls | readonly Segment[] | |
pins | readonly PinSpec[] | |
hero | { x: number; y: number; } | |
gold (optional) | { x: number; y: number; } | undefined | |
fluids | readonly FluidSpec[] | |
spikes | readonly Segment[] | Spikes: touching one loses. |
zone | Zone | |
goal | "hero" | "gold" | "either" | What has to reach the safe place: the hero, the gold, or whichever gets there first. |
Examples
import type { PinRescueEntry } from "@johnmorrisdotca/karakuri/levels";
import { PIN_RESCUE_LEVELS } from "@johnmorrisdotca/karakuri/levels";
const value: PinRescueEntry = PIN_RESCUE_LEVELS[0];
console.log(value);{
walls: [
{ ax: 70, ay: 40, bx: 70, by: 440 },
{ ax: 290, ay: 40, bx: 290, by: 440 },
{ ax: 70, ay: 440, bx: 290, by: 440 },
{ ax: 70, ay: 40, bx: 290, by: 40 }
],
pins: [
{ x: 74, y: 250, length: 212, side: 'left' },
{ x: 286, y: 130, length: 212, side: 'right' }
],
hero: { x: 180, y: 232 },
fluids: [ { kind: 'lava', x: 78, y: 70, w: 204, h: 55 } ],
spikes: [],
zone: { x: 74, y: 405, w: 212, h: 35 },
goal: 'hero',
solution: [ 0 ],
loss: [ 1 ]
}What it prints (run when this page was built)