MixedBoard型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A native mixed recipe with its flat maze and arrow layers.
インポート
import type { MixedBoard } from "@johnmorrisdotca/meikyuu";
定義
type MixedBoard = {
readonly recipe: MixedRecipe;
readonly arrows: ArrowBoard;
readonly maze: Maze;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
recipe | MixedRecipe | |
arrows | ArrowBoard | |
maze | Maze |
例
import type { ArrowRecipe, MazeRecipe, MixedBoard, MixedRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, buildMixed, makeArrows } from "@johnmorrisdotca/meikyuu";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
const arrowRecipe: ArrowRecipe = {shape:"square",w:5,h:5,longest:3,seed:42};
const arrows = makeArrows(arrowRecipe);
const mixedRecipe: MixedRecipe = {maze:recipe,arrows:arrowRecipe};
const mixed = buildMixed(mixedRecipe);
const value: MixedBoard = mixed;
console.log(value);{
recipe: {
maze: {
shape: 'square',
w: 5,
h: 5,
algorithm: 'backtracker',
mode: 'to-goal',
seed: 42
},
arrows: { shape: 'square', w: 5, h: 5, longest: 3, seed: 42 }
},
arrows: {
recipe: { shape: 'square', w: 5, h: 5, longest: 3, seed: 42 },
w: 5,
h: 5,
inShape: [
true, true, true, true, true,
true, true, true, true, true,
true, true, true, true, true,
true, true, true, true, true,
true, true, true, true, true
],
arrows: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
],
locked: [
false, false, false,
false, false, false,
false, false, false,
false, false, false,
false
]
},
maze: {
recipe: {
shape: 'square',
w: 5,
h: 5,
algorithm: 'backtracker',
mode: 'to-goal',
seed: 42
},
grid: {
shape: 'square',
w: 5,
h: 5,
centres: [Array],
sides: [Array],
box: [Object],
at: [Function: at],
cells: 25,
neighbours: [Array]
},
links: [
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array], [Array], [Array],
[Array]
],
start: 6,
goal: 15,
entrance: null,
exit: null,
keys: []
}
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。