/elm-grid

Primary LanguageElmApache License 2.0Apache-2.0

Grid

This package defines 2-dimensional Grids and functions to operate them.

For example, you may want to represent a Go board as a 19x19 grid with Maybe Pieces.

Let's first define pieces.

Type Piece = White | Black

Then we can initialize the board as empty.

initialBoard : Grid (Maybe Piece)
initialBoard =
    Grid.repeat 19 19 empty

Then we can use Grid.get and Grid.set to access and modify the values in grid.

License

This package follows Apache License Version 2.0.