Crates.io | rust-grid |
lib.rs | rust-grid |
version | 0.1.1 |
source | src |
created_at | 2021-09-07 17:25:23.626272 |
updated_at | 2021-09-07 19:55:21.696984 |
description | Very minimal library to store large grids of any type in memory, with a user-friendly interface |
homepage | https://github.com/wait-what/rust-grid |
repository | https://github.com/wait-what/rust-grid |
max_upload_size | |
id | 448149 |
size | 6,770 |
rust-grid is a very minimal library to store large grids of any type in memory, with a user-friendly interface.
use rust_grid::*;
fn main() {
let grid: Grid<bool> = Grid::new(10, 15, false);
// Two ways to access data
let (x, y) = (3, 4);
println!("{}", grid[y][x]);
println!("{}", grid[(x, y)]);
// Get the size
let (width, height) = grid.size();
}