mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-11-13 00:13:49 +00:00
27 lines
523 B
Rust
27 lines
523 B
Rust
|
use crate::BRIGHTNESS;
|
||
|
use crate::HEIGHT;
|
||
|
use crate::Q;
|
||
|
use crate::WIDTH;
|
||
|
|
||
|
pub struct Cell {
|
||
|
pub x: u32,
|
||
|
pub y: u32,
|
||
|
pub state: u32,
|
||
|
}
|
||
|
|
||
|
pub fn init_grid() -> Vec<Vec<Cell>> {
|
||
|
let mut grid: Vec<Vec<Cell>> = Vec::new();
|
||
|
for j in 0..HEIGHT {
|
||
|
let mut row: Vec<Cell> = Vec::new();
|
||
|
for i in 0..WIDTH {
|
||
|
row.push(Cell {
|
||
|
x: i,
|
||
|
y: j,
|
||
|
state: 0,
|
||
|
});
|
||
|
}
|
||
|
grid.push(row);
|
||
|
}
|
||
|
grid
|
||
|
}
|