CrossSumsRatingtype
How hard a board is, measured by solving it. depth 0 means the rules solve it, 1 that somebody has to suppose a
digit and watch it break, 2 that more than that is needed; plain says the single-run rules were enough (no
digit that must appear had to be traced). probes is how many suppositions depth 1 needed. The rest describes the runs.
Import it
import type { CrossSumsRating } from "@johnmorrisdotca/kazu/cross-sums";
Also exported from: @johnmorrisdotca/kazu
Definition
type CrossSumsRating = {
depth: 0 | 1 | 2;
plain: boolean;
probes: number;
whites: number;
runs: number;
longest: number;
meanRun: number;
fixedShare: number;
};
Members
| Name | Type | Description |
|---|---|---|
depth | 0 | 1 | 2 | |
plain | boolean | |
probes | number | |
whites | number | |
runs | number | |
longest | number | |
meanRun | number | Mean number of squares in a run. |
fixedShare | number | Runs whose total can be made in only one way, as a share of the runs. |
Examples
import type { CrossSumsBoard, CrossSumsRating } from "@johnmorrisdotca/kazu/cross-sums";
import { rateCrossSums } from "@johnmorrisdotca/kazu/cross-sums";
const crossSumsBoard: CrossSumsBoard = {"width":5,"height":5,"cells":[{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":10},{"kind":"black","across":null,"down":7},{"kind":"black","across":null,"down":12},{"kind":"black","across":null,"down":null},{"kind":"black","across":6,"down":null},{"kind":"white"},{"kind":"white"},{"kind":"white"},{"kind":"black","across":null,"down":null},{"kind":"black","across":23,"down":null},{"kind":"white"},{"kind":"white"},{"kind":"white"},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null}]};
const value: CrossSumsRating = rateCrossSums(crossSumsBoard);
console.log(value);{
depth: 0,
plain: true,
probes: 0,
whites: 6,
runs: 5,
longest: 3,
meanRun: 2.4,
fixedShare: 0.4
}What it prints (run when this page was built)