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 · Number-puzzle engines

towersSeenfunction

How many towers show looking along heights from its first end: each one taller than every one before it.

Import it

import { towersSeen } from "@johnmorrisdotca/kazu";

Definition

function towersSeen(heights: readonly number[]): number

Parameters

NameTypeDescription
heightsreadonly number[]

Tower heights in viewing order, nearest first.

Returns

number

How many towers show looking along heights from its first end: each one taller than every one before it.

Examples

import { towersSeen } from "@johnmorrisdotca/kazu";

console.log(towersSeen([1,3,2,4]));
3

What it prints (run when this page was built)

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