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 · Nurikabe rules

newNurikabefunction

Create the initial immutable Nurikabe game from a valid board.

Import it

import { newNurikabe } from "@johnmorrisdotca/kazu/nurikabe";

Also exported from: @johnmorrisdotca/kazu

Definition

function newNurikabe(board: NurikabeBoard): NurikabeGame

Parameters

NameTypeDescription
boardNurikabeBoard

The valid native board with its printed clues and dimensions.

Returns

NurikabeGame

Create the initial immutable Nurikabe game from a valid board.

Examples

import type { NurikabeBoard } from "@johnmorrisdotca/kazu/nurikabe";
import { newNurikabe } from "@johnmorrisdotca/kazu/nurikabe";

const nurikabeBoard: NurikabeBoard = {"size":5,"clues":[1,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,2,0,0,3,0,0]};
console.log(newNurikabe(nurikabeBoard));
{
  board: {
    size: 5,
    clues: [
      1, 0, 0, 0, 0, 0, 0, 0,
      0, 6, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 2, 0, 0, 3, 0,
      0
    ]
  },
  sea: [
    false, false, false, false,
    false, false, false, false,
    false, false, false, false,
    false, false, false, false,
    false, false, false, false,
    false, false, false, false,
    false
  ],
  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.