mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
bugfix: x, y mismatch
This commit is contained in:
parent
b17c4452e7
commit
ca4b04723f
@ -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>>) {
|
pub fn display_grid(grid: &Vec<Vec<Cell>>) {
|
||||||
for i in 0..HEIGHT {
|
for j in 0..HEIGHT {
|
||||||
for j in 0..WIDTH {
|
for i in 0..WIDTH {
|
||||||
let x = i as usize;
|
let x = i as usize;
|
||||||
let y = j 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());
|
let index = map_num(state, 0, Q as usize, 0, BRIGHTNESS.len());
|
||||||
print!("{}", BRIGHTNESS.chars().nth(index).unwrap());
|
print!("{}", BRIGHTNESS.chars().nth(index).unwrap());
|
||||||
|
Loading…
Reference in New Issue
Block a user