UNPKG

@thi.ng/grid-iterators

Version:

2D grid and shape iterators w/ multiple orderings

13 lines (12 loc) 230 B
import { __opts } from "./utils.js"; function* columnEnds2d(opts) { let { cols, rows, tx } = __opts(opts); rows--; for (let x = 0; x < cols; x++) { yield tx(x, 0); yield tx(x, rows); } } export { columnEnds2d };