rateRegionsfunction
Rates a board with one answer by solving it as a person would: with the rules, then by supposing one number at a time.
Import it
import { rateRegions } from "@johnmorrisdotca/kazu/regions";
Also exported from: @johnmorrisdotca/kazu
Definition
function rateRegions(board: RegionsBoard): RegionsRating
Parameters
| Name | Type | Description |
|---|---|---|
board | RegionsBoard | The valid native board with its printed clues and dimensions. |
Returns
RegionsRating
Rates a board with one answer by solving it as a person would: with the rules, then by supposing one number at a time.
Examples
import type { RegionsBoard } from "@johnmorrisdotca/kazu/regions";
import { rateRegions } from "@johnmorrisdotca/kazu/regions";
const regionsBoard: RegionsBoard = {"width":5,"height":5,"givens":[0,0,2,0,3,2,0,3,0,0,0,3,0,0,1,3,1,0,1,2,3,3,4,0,0]};
console.log(rateRegions(regionsBoard));{
depth: 0,
probes: 0,
givens: 13,
givenShare: 0.52,
regions: 12,
unnamed: 2,
largest: 4,
meanRegion: 2.0833333333333335
}What it prints (run when this page was built)