This is a base class in BRIDGES for representing an (n x n) grid.
- Author
- David Burlinson, Matthew McQuaigue
- Date
- 2018, 7/24/19, 2021
- See also
- Color grid tutorial at https://bridgesuncc.github.io/tutorials/Grid.html
◆ __init__()
None bridges.grid.Grid.__init__ |
( |
|
self, |
|
|
** |
kwargs |
|
) |
| |
Grid constructor.
- Parameters
-
size | size of the grid as array |
rows | number of rows in grid |
cols | number of the columns in grid |
- Returns
-
None
- Exceptions
-
ValueError | if the size dimensions are greater than the max grid sizes (1080, 1920) |
◆ dimensions()
list bridges.grid.Grid.dimensions |
( |
|
self | ) |
|
Getter for the dimensions of the grid.
- Returns
-
list as the dimensions of the grid
◆ get()
def bridges.grid.Grid.get |
( |
|
self, |
|
|
int |
row, |
|
|
int |
col |
|
) |
| |
Get the row,col element in the grid.
(int) row: row the element is in
(int) col: col the element is in
- Returns
-
element
-
none
-
Raises
-
Exception printing the traceback stack if returning the row and column is an error
◆ get_data_structure_type()
str bridges.grid.Grid.get_data_structure_type |
( |
|
self | ) |
|
◆ set()
None bridges.grid.Grid.set |
( |
|
self, |
|
|
int |
row, |
|
|
int |
col, |
|
|
|
val |
|
) |
| |
set the (row, col) element in the grid
- Parameters
-
row | row position |
col | column position |
val | value to be set in (row, col) position |
- Returns
-
None
- Exceptions
-
Exception | if setting the element at the row and column is a problem |
◆ grid
◆ grid_size
list bridges.grid.Grid.grid_size = [10, 10] |
|
static |
◆ maxGridSize
list bridges.grid.Grid.maxGridSize = [1080, 1920] |
|
static |
The documentation for this class was generated from the following file:
- /home/erik/work/bridges/bridges-python/bridges/grid.py