Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

Reference · Akari rules

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

NameTypeDescription
boardAkariBoard

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.