isTooEasy関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Whether a maze is too easy to be a level: it falls short of any of MEIKYUU_LEAST, or, with a place in the easy third of a size, of easyFloorAt(place).
インポート
import { isTooEasy } from "@johnmorrisdotca/meikyuu";
定義
function isTooEasy(difficulty: MazeDifficulty, place?: number): boolean
引数
| 名前 | 型 | 説明 |
|---|---|---|
difficulty | MazeDifficulty | The native geometry-aware difficulty result. |
place (省略可) | number | undefined | The native numbered level position. |
戻り値
boolean
Whether a maze is too easy to be a level: it falls short of any of MEIKYUU_LEAST, or, with a place in the easy third of a size, of easyFloorAt(place).
例
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, difficultyOf, isTooEasy } from "@johnmorrisdotca/meikyuu";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
console.log(isTooEasy(difficultyOf(maze),1));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。