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

nurikabeNeighborsfunction

Read orthogonally adjacent cells on a square Nurikabe board.

Import it

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

Also exported from: @johnmorrisdotca/kazu

Definition

function nurikabeNeighbors(size: number, cell: number): number[]

Parameters

NameTypeDescription
sizenumber

The supported square board side length.

cellnumber

A zero-based row-major cell index.

Returns

number[]

Read orthogonally adjacent cells on a square Nurikabe board.

Examples

import type { NurikabeBoard } from "@johnmorrisdotca/kazu/nurikabe";
import { nurikabeNeighbors } 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(nurikabeNeighbors(nurikabeBoard.size,0));
[ 1, 5 ]

What it prints (run when this page was built)

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