Skip to the content

Tenka天下

Play seeded world conquest for two to six, with dice battles, cards, computer players and saved games.

Tenka means the world under heaven in Japanese. About the name

Contents

Reference · Browser table and SVG

nearestLandfunction

The territory whose counter is nearest a point of the map, within reach map units, or null.

Import it

import { nearestLand } from "@johnmorrisdotca/tenka/ui";

Definition

function nearestLand(x: number, y: number, reach: number, map?: TenkaMapKey): number | null

Parameters

NameTypeDescription
xnumber

The horizontal map-unit coordinate.

ynumber

The vertical map-unit coordinate.

reachnumber

The maximum map-unit distance to consider.

map (optional)TenkaMapKey

The native world or Europe map to use.

Returns

number | null

The nearest territory within reach, or null when none qualifies.

Examples

import { nearestLand } from "@johnmorrisdotca/tenka/ui";

console.log(nearestLand(200,200,100));
1

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tenka 2.2.0.