Grid
Associated Functions for the Grid type
Built-in associated functions for the Grid<T, W, H> type.
A 2D grid with fixed width and height dimensions for efficient spatial data storage.
Element Access
get
fn get(self, x: Int, y: Int) -> T
Returns the element at the specified (x, y) coordinates.
set
fn set(self, x: Int, y: Int, element: T)
Sets the element at the specified (x, y) coordinates.
Dimensions
width
fn width(self) -> Int
Returns the width of the grid.
height
fn height(self) -> Int
Returns the height of the grid.
Index
Examples
grid[10, 20] = 44
b := grid[x, 99]