rateAkarifunction
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. A board with no single answer cannot be rated.
Import it
import { rateAkari } from "@johnmorrisdotca/kazu/akari";
Also exported from: @johnmorrisdotca/kazu
Definition
function rateAkari(board: AkariBoard): AkariRating
Parameters
| Name | Type | Description |
|---|---|---|
board | AkariBoard | The valid native board with its printed clues and dimensions. |
Returns
AkariRating
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. A board with no single answer cannot be rated.
Examples
import type { AkariBoard } from "@johnmorrisdotca/kazu/akari";
import { rateAkari } from "@johnmorrisdotca/kazu/akari";
const akariBoard: AkariBoard = {"width":5,"height":5,"cells":[1,null,null,null,null,0,null,null,null,0,1,0,null,null,null,null,false,null,null,null,null,false,null,null,2]};
console.log(rateAkari(akariBoard));{
depth: 0,
probes: 0,
whites: 17,
blacks: 8,
clues: 6,
bulbs: 5,
clueShare: 0.75,
openShare: 0.68
}What it prints (run when this page was built)