mirror of
https://github.com/avahe-kellenberger/seq2d
synced 2026-01-15 04:51:47 +00:00
No description
| src | ||
| tests | ||
| LICENCE | ||
| README.md | ||
| seq2d.nimble | ||
Seq2D
Two-dimensional array implementation.
Usage
var grid = newSeq2D[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