parseRoute
Read a route from the command line (0,0 3,4 3,0).
import type { Point } from "#codebase/geo"; export const parseRoute = (args: string[]): Point[] => args.map((a) => { const [x, y] = a.split(",").map(Number); return { x: x!, y: y! }; })
Read a route from the command line (0,0 3,4 3,0).
import type { Point } from "#codebase/geo"; export const parseRoute = (args: string[]): Point[] => args.map((a) => { const [x, y] = a.split(",").map(Number); return { x: x!, y: y! }; })