No description
Find a file
Avahe Kellenberger 8ef8209e01 Initial commit.
2022-07-22 22:32:01 -04:00
src Initial commit. 2022-07-22 22:32:01 -04:00
tests Initial commit. 2022-07-22 22:32:01 -04:00
array2d.nimble Initial commit. 2022-07-22 22:32:01 -04:00
LICENCE Initial commit. 2022-07-22 22:32:01 -04:00
README.md Initial commit. 2022-07-22 22:32:01 -04:00

Array2D

Two-dimensional array implementation.

Usage

var grid = newArray2D[int](5, 6)

# Set data at a particular point in the "grid"
grid[2, 3] = 14

doAssert(grid[2, 3] == 14)

# Iterate over the grid
for x, y, value in grid.items:
  echo "[" & $x & ", " & $y & "] = " & $value

# Items can be mutated using `mitems`
for x, y, value in grid.mitems:
  if x mod 2 == 0:
    value = 1