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 · Cross Sums rules

CrossSumsGametype

The immutable CrossSums board, current entries or marks, undo history and assistance state.

Import it

import type { CrossSumsGame } from "@johnmorrisdotca/kazu/cross-sums";

Also exported from: @johnmorrisdotca/kazu

Definition

type CrossSumsGame = {
    board: CrossSumsBoard;
    values: readonly number[];
    notes: readonly (readonly number[])[];
    history: readonly {
        values: readonly number[];
        notes: readonly (readonly number[])[];
    }[];
    helped: boolean;
};

Members

NameTypeDescription
boardCrossSumsBoard
valuesreadonly number[]
notesreadonly (readonly number[])[]
historyreadonly { values: readonly number[]; notes: readonly (readonly number[])[]; }[]
helpedboolean

Examples

import type { CrossSumsBoard, CrossSumsGame } from "@johnmorrisdotca/kazu/cross-sums";
import { newCrossSums } 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 crossSumsGame = newCrossSums(crossSumsBoard);
const value: CrossSumsGame = crossSumsGame;
console.log(value);
{
  board: {
    width: 5,
    height: 5,
    cells: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ]
  },
  values: [
    0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0,
    0
  ],
  notes: [
    [], [], [], [], [], [], [], [],
    [], [], [], [], [], [], [], [],
    [], [], [], [], [], [], [], [],
    []
  ],
  history: [],
  helped: false
}

What it prints (run when this page was built)

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