本文へ移動

Meikyuu迷宮

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

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

目次

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

layoutCells関数

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

How many cells laying out a recipe's grid takes, counted before anything is built: the grid's own cells for squares, hexagons, triangles and circles, and the whole raster for a shape cut out of one (a cut-out shape keeps fewer, but is built from all of them). A hexagon of radius w is cut from a hex grid 2w + 1 across, and a pyramid of w rows from a triangle grid twice as wide as it is tall.

インポート

import { layoutCells } from "@johnmorrisdotca/meikyuu";

定義

function layoutCells(shape: MeikyuuShape, w: number, h: number): number

引数

名前型説明
shape"square" | "circle" | "hex" | "triangle" | "heart" | "leaf" | "star" | "ring" | "diamond" | "cross" | "moon" | "hexagon" | "pyramid"

The supported native flat-grid geometry or cut-out shape.

wnumber

The native grid width in cells.

hnumber

The native grid height in cells.

戻り値

number

How many cells laying out a recipe's grid takes, counted before anything is built: the grid's own cells for squares, hexagons, triangles and circles, and the whole raster for a shape cut out of one (a cut-out shape keeps fewer, but is built from all of them). A hexagon of radius w is cut from a hex grid 2w + 1 across, and a pyramid of w rows from a triangle grid twice as wide as it is tall.

例

import { layoutCells } from "@johnmorrisdotca/meikyuu";

console.log(layoutCells("square",5,5));
25

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

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

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