diff options
Diffstat (limited to 'CLI/rust/src/game_of_life')
| -rw-r--r-- | CLI/rust/src/game_of_life/simulation/universe.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CLI/rust/src/game_of_life/simulation/universe.rs b/CLI/rust/src/game_of_life/simulation/universe.rs index dab1915..6059dc6 100644 --- a/CLI/rust/src/game_of_life/simulation/universe.rs +++ b/CLI/rust/src/game_of_life/simulation/universe.rs @@ -82,7 +82,7 @@ mod display { impl Index<isize> for Universe { type Output = Plane<bool>; fn index(&self, idx: isize) -> &Plane<bool> { - let len = self.current.0.len() as isize; + let len = self.current.len() as isize; &self.current[circular_index(idx, len) as isize] } } @@ -170,7 +170,7 @@ impl Universe { /// set the current state to the next future generation pub(crate) fn evolve(mut self) -> Self { for row in 0..self.current.len() { - for col in 0..self.current.0.len() as isize { + for col in 0..self.current[row].len() as isize { let living_neighbors = self .neighbors(row, col) .iter() |
