generateAkari関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Makes a seeded board and proves it has one answer. A random wall of black squares is lit by randomly placed
bulbs, every black square that touches a white one is numbered, and then numbers are taken away for as long as
the puzzle can still be solved the way the level asks: easy and medium by the rules alone (easy keeps most
of its numbers), hard by supposing one square at a time, extra-hard for as long as the answer stays single,
which leaves a board that needs more supposing than that. If no board of the level is found within the
attempts, the next one down is tried; if none of the levels finds one, the same is tried again with more
black squares, which a large board needs to be solvable at all (see AKARI_DENSER_CROWDS). The fixed lattice
of the first generator is only what is left if even that fails, which no seed does at any size offered.
インポート
import { generateAkari } from "@johnmorrisdotca/kazu/akari";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
function generateAkari(width?: number, height?: number, seed?: number, level?: AkariLevel): AkariPuzzle
引数
| 名前 | 型 | 説明 |
|---|---|---|
width (省略可) | number | The supported board width in cells. |
height (省略可) | number | The supported board height in cells. |
seed (省略可) | number | The reproducible native puzzle seed. |
level (省略可) | AkariLevel | The requested native difficulty tier. |
戻り値
AkariPuzzle
Makes a seeded board and proves it has one answer. A random wall of black squares is lit by randomly placed bulbs, every black square that touches a white one is numbered, and then numbers are taken away for as long as the puzzle can still be solved the way the level asks: easy and medium by the rules alone (easy keeps most of its numbers), hard by supposing one square at a time, extra-hard for as long as the answer stays single, which leaves a board that needs more supposing than that. If no board of the level is found within the attempts, the next one down is tried; if none of the levels finds one, the same is tried again with more black squares, which a large board needs to be solvable at all (see AKARI_DENSER_CROWDS). The fixed lattice of the first generator is only what is left if even that fails, which no seed does at any size offered.
例
import { generateAkari } from "@johnmorrisdotca/kazu/akari";
console.log(generateAkari(5,5,42,"easy"));この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。