本文へ移動

Meikyuu迷宮

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

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

目次

リファレンス · 立体表面の規則と形

SOLID_KINDS定数

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

THE SURFACE OF A SOLID AS A CELL GRAPH: the one thing a maze over a solid is made on. A solid is a closed surface cut into cells; each cell has the cells beside it, one across each of its sides, and nothing is the edge of the shape, because a surface has none. The generators, the measure and the game read only cells and neighbours (as they do for a flat maze), so a maze over a cube is carved by the very same algorithms as a maze on a page, and what is new is only where the cells lie in space.

Five solids were the first, each cut into cells in a way that suits it:

  • cube: six squares, each n by n, with the cells of one face joined to the cells of the next across every edge of the cube (6 n^2 cells).
  • sphere: a geodesic globe, a football: the dual of an icosahedron cut n ways along each edge, so its cells are 12 pentagons and the rest hexagons (10 n^2 + 2 cells). It was weighed against a cube with its corners rounded off, which has the very graph of the cube and so would be the same maze in a different coat. The football's cells are nearly equal in size all over the globe, with no poles and no seams; its twelve pentagons are the corners, each with only five ways out.
  • tetrahedron, octahedron, icosahedron: four, eight and twenty triangles, each cut n ways along its edges into n^2 small triangles (4 n^2, 8 n^2 and 20 n^2 cells). A triangle has three ways out, so these mazes branch least and run longest.

Twelve more came after them (solidShapes.ts): the dice a person may know (the dodecahedron, the ten-sided trapezohedron, the rhombic and deltoidal ones, a bipyramid and a prism) and shapes that are not dice (a box, a cross of cubes, a ring, a star and a heart). They are cut into cells the same way: every polygon face of the shape is divided into smaller ones, and the cells of one face are joined to the next across every edge.

A cell is a flat polygon (a curved cell of the sphere is the flat polygon through its corners). Its sides are in a fixed order, counter-clockwise seen from outside, starting at a corner that is fixed by how the grid is built, and neighbours[cell][side] is the cell across that side. That order is part of the format: a line kept as steps (lineToSteps) is the position of each cell among its predecessor's neighbours, so it is the same line for ever and on every device. Everything that decides the graph is integer arithmetic (a corner is found by whole-number weights, never by a rounded coordinate), so the same solid is the same graph in every browser and every Node.

インポート

import { SOLID_KINDS } from "@johnmorrisdotca/meikyuu/3d";

ほかのエクスポート元: @johnmorrisdotca/meikyuu/3d/levels, @johnmorrisdotca/meikyuu/3d/levels/dice, @johnmorrisdotca/meikyuu/3d/levels/shapes, @johnmorrisdotca/meikyuu/3d/levels/all

定義

const SOLID_KINDS: readonly ["cube", "sphere", "tetrahedron", "octahedron", "icosahedron", "prism", "trapezohedron", "dodecahedron", "rhombic-dodecahedron", "bipyramid", "icositetrahedron", "triacontahedron", "box", "cross", "ring", "torus", "star", "heart"] = ["cube", "sphere", "tetrahedron", "octahedron", "icosahedron", ...SOLID_SHAPE_KINDS] as const

例

import { SOLID_KINDS } from "@johnmorrisdotca/meikyuu/3d";
console.log(SOLID_KINDS);
[
  'cube',                 'sphere',
  'tetrahedron',          'octahedron',
  'icosahedron',          'prism',
  'trapezohedron',        'dodecahedron',
  'rhombic-dodecahedron', 'bipyramid',
  'icositetrahedron',     'triacontahedron',
  'box',                  'cross',
  'ring',                 'torus',
  'star',                 'heart'
]

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

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

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