本文へ移動

Meikyuu迷宮

シード付きの迷路と矢印パズルを作り、番号付きの問題を進め、平面や立体表面で遊べます。

「迷宮」は迷路のように入り組んだ場所を表す言葉です。 名前について(英語)

目次

リファレンス · 迷路・矢印・混合の盤

ArrowTap型

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

What a tap did.

インポート

import type { ArrowTap } from "@johnmorrisdotca/meikyuu";

定義

type ArrowTap = {
    readonly game: ArrowGame;
    readonly result: "removed" | "blocked" | "locked" | "ignored";
    readonly by?: number;
};

メンバー

名前型説明
gameArrowGame
result"removed" | "blocked" | "locked" | "ignored"
by (省略可)number | undefined

The arrow in the way, for blocked, and for the locked result of an arrow that waits for the unlock (the tapped arrow itself is not locked then): a locked arrow in its way if there is one.

例

import type { ArrowRecipe, ArrowTap } from "@johnmorrisdotca/meikyuu";
import { hintArrow, makeArrows, newArrowGame, tapArrow } from "@johnmorrisdotca/meikyuu";

const arrowRecipe: ArrowRecipe = {shape:"square",w:5,h:5,longest:3,seed:42};
const arrows = makeArrows(arrowRecipe);
const arrowGame = newArrowGame(arrows);
const arrowId = hintArrow(arrowGame)!;
const value: ArrowTap = tapArrow(arrowGame,arrowId);
console.log(value);
{
  game: {
    board: {
      recipe: [Object],
      w: 5,
      h: 5,
      inShape: [Array],
      arrows: [Array],
      locked: [Array]
    },
    present: [
      true,  true, true,
      true,  true, true,
      true,  true, true,
      true,  true, true,
      false
    ],
    hearts: 3,
    heartsAtStart: 3,
    unlocked: true,
    status: 'playing',
    taken: [ 12 ],
    mistakes: 0
  },
  result: 'removed'
}

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

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

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