本文へ移動

Karakuriからくり

8つの標準のパズルで遊び、探索や再現できる物理を使い、ポインターやキーボードで操作する盤を表示できます。

「からくり」は、仕組みや工夫した装置を表す言葉です。 名前について(英語)

目次

リファレンス · 標準の問題一覧

RopeCutEntry型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A level and the cuts that win it, in order: the step to cut at, which rope, which link of it.

インポート

import type { RopeCutEntry } from "@johnmorrisdotca/karakuri/levels";

定義

interface RopeCutEntry extends RopeLevel {
    solution: readonly {
        at: number;
        rope: number;
        link: number;
    }[];
    loss: readonly {
        at: number;
        rope: number;
        link: number;
    }[];
}

メンバー

名前型説明
solutionreadonly { at: number; rope: number; link: number; }[]
lossreadonly { at: number; rope: number; link: number; }[]
anchorsreadonly { x: number; y: number; }[]

Where each rope is fixed. A rope runs from there to the load.

load{ x: number; y: number; r: number; }
platformsreadonly Platform[]
goal{ kind: "zone" | "button"; area: Area; }

What wins: the load's centre in a zone, or the load touching a button.

pitYnumber

Where the load is lost: below pitY, or in any of these.

pitsreadonly Area[]

例

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: []
}

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/karakuri 0.2.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。