generateShikaku関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.
インポート
import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
function generateShikaku(width?: number, height?: number, level?: ShikakuLevel, seed?: number): ShikakuPuzzle
引数
| 名前 | 型 | 説明 |
|---|---|---|
width (省略可) | number | The supported board width in cells. |
height (省略可) | number | The supported board height in cells. |
level (省略可) | ShikakuLevel | The requested native difficulty tier. |
seed (省略可) | number | The reproducible native puzzle seed. |
戻り値
ShikakuPuzzle
Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.
例
import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";
console.log(generateShikaku(5,5,"easy",42));この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。