bugfix: x, y mismatch

This commit is contained in:
Baipyrus 2024-05-07 13:30:18 +02:00
parent b17c4452e7
commit ca4b04723f

View File

@ -81,11 +81,11 @@ fn map_num(n: usize, s: usize, e: usize, a: usize, b: usize) -> usize {
}
pub fn display_grid(grid: &Vec<Vec<Cell>>) {
for i in 0..HEIGHT {
for j in 0..WIDTH {
for j in 0..HEIGHT {
for i in 0..WIDTH {
let x = i as usize;
let y = j as usize;
let state = grid[x][y].state as usize;
let state = grid[y][x].state as usize;
let index = map_num(state, 0, Q as usize, 0, BRIGHTNESS.len());
print!("{}", BRIGHTNESS.chars().nth(index).unwrap());