Reference
Akari rules
import { … } from "@johnmorrisdotca/kazu/akari";
9.1 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
AKARI_DENSER_ATTEMPTS | constant | The native Akari generation-attempt limit for each denser fallback. |
AKARI_DENSER_CROWDS | constant | When a level finds no board in AKARI_MOST_ATTEMPTS plain attempts (a large board of an easy level, mostly: one attempt in a hundred succeeds on a 14×14), the generator tries again with more black squares, each of these multiples of the usual share in turn, AKARI_DENSER_ATTEMPTS attempts at each. |
AKARI_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateAkari. |
AKARI_MOST_ATTEMPTS | constant | The native Akari generation-attempt limit. |
AKARI_MOST_NODES | constant | The native Akari search-node budget. |
AKARI_MOST_SIDE | constant | The maximum supported Akari board dimension. |
AKARI_PLAY_STYLE | constant | Scoped native Akari board and player CSS. |
AKARI_SIZES | constant | The sides the demo and the site offer for a square board; any side from 2 to AKARI_MOST_SIDE can be made. |
AKARI_STRINGS | constant | Native English and Japanese labels and announcements for Akari. |
AkariBoard | type | A board is row-major. |
AkariCheck | type | The Akari completion result and cells that violate its native rules. |
AkariDrawOptions | type | Current Akari marks or entries, selection, errors and native SVG appearance choices. |
akariFinished | function | A game is finished only when its bulbs satisfy every rule and light every white square. |
AkariGame | type | The immutable Akari board, current entries or marks, undo history and assistance state. |
AkariLanguage | type | The native English or Japanese display language for Akari. |
AkariLevel | type | A native difficulty tier for generated Akari puzzles. |
AkariMaterial | type | A supported material of the native Akari board. |
AkariMount | type | The mounted Akari game and progress, native controls and cleanup handle. |
AkariMountOptions | type | The initial Akari board, native progress, appearance and host event callbacks. |
akariNeighbours | function | Returns the orthogonally adjacent cells to a board position. |
AkariPieces | type | A supported native Akari mark or piece appearance. |
AkariProgress | type | The Akari constraint status of a partial board. |
AkariPuzzle | type | A seeded Akari board with its verified solution and native difficulty tier. |
AkariRating | type | How hard a board is, measured by solving it. |
AkariSolve | type | A bounded Akari solve result: answer count, first solution, node work and whether the search completed. |
akariVisible | function | White squares visible from a cell, including itself, stopping at black squares and edges. |
checkAkari | function | Checks a complete placement from the public rules, without consulting a stored answer. |
decodeAkari | function | Decodes a bounded save after validating the board and each placement. |
drawAkari | function | Draws the public clues and current bulbs as SVG. |
encodeAkari | function | Encodes only public clues and player placements. |
generateAkari | function | Makes a seeded board and proves it has one answer. |
hintAkari | function | Returns a missing bulb, or an extra bulb to remove, only after uniqueness is proved. |
isAkariBoard | function | Validates dimensions and the three public square kinds. |
mountAkari | function | Mounts the player in a host element; call destroy when the host is removed. |
newAkari | function | Starts a game with only its public board data. |
progressAkari | function | Reports immediate contradictions while allowing required clues to remain unsatisfied during play. |
rateAkari | function | Rates a board by solving it as a person would: with the rules alone (depth 0), then with one supposition at a time (depth 1), and anything beyond that is depth 2. |
solveAkari | function | Bounded constraint search over the rules in akariLogic.ts; a stopped proof is always marked incomplete. |
toggleAkari | function | Toggles a bulb on a white square and keeps one prior turn for undo. |
undoAkari | function | Restores the last bulb placement. |