/grid

2D grid of near infinite size containing values of any type.

Primary LanguageGoMIT LicenseMIT

grid

Build Status Go Report Card GoDoc License: MIT

2D grid of near infinite size containing values of any type.

Installation

go get -u github.com/eleniums/grid

Example

// create a new grid
grid := NewGrid()

// add a value to the grid at (x: 1, y: 2)
grid.Add(1, 2, value)

// retrieve a value from the grid at (x: 1, y: 2)
value, ok := grid.Retrieve(1, 2)
if ok {
    // do something with value
}

// delete a value from the grid at (x: 1, y: 2)
grid.Delete(1, 2)