DIRECTIONSconstant
The four line orientations through a point. Each is checked in both its forward and reverse sense, so four entries cover all eight neighbours.
Import it
import { DIRECTIONS } from "@johnmorrisdotca/narabe";
Definition
const DIRECTIONS: readonly Point[] = [
{ row: 0, col: 1 },
{ row: 1, col: 0 },
{ row: 1, col: 1 },
{ row: 1, col: -1 },
]
Examples
import { DIRECTIONS } from "@johnmorrisdotca/narabe";
console.log(DIRECTIONS);[
{ row: 0, col: 1 },
{ row: 1, col: 0 },
{ row: 1, col: 1 },
{ row: 1, col: -1 }
]What it prints (run when this page was built)