horton.grid.Grid(width, height[, value]) | A Grid is a two-dimensional data-structure. |
horton.grid.Torus(width, height[, value]) | A Grid whose edges are connected. |
A Grid is a two-dimensional data-structure.
It provides the Python Mapping interface whose keys are tuples representing co-ordinates in the Grid.
Return a grid whose values are comprised by adding the values of two grids together.
Return True of value can be found in the grid.
Return True if equal to other.
Two grids are considered equal if every value in the grids are equal.
Return something from the grid.
The first argument of args is a tuple. If the elements of the tuple are integers then fetch the value at the coordinate. If the elements are slices then return a Grid from the region defined by them.
Return an iterator over the values.
Return the total size.
Set an item in the grid to a value.
The first argument is an (x, y) tuple and the second is the value.
Return a grid whose values are comprised by subtracting the values from one by the other.
Return the list of coordinates.
This value is cached internally after the initial call.
Return a new Grid as a copy of other.
Return the dimensions tuple.
Create a Grid from an array.
Return a value at x, y.
Return a default value if the key cannot be found.
Return a list of co-ordinate, value pairs.
Yield successive co-ordinate, value pairs.
Pretty print a Grid object.
Return a copy of the grid values.