mirror of
https://github.com/italicsjenga/mini_gl_fb.git
synced 2024-11-22 23:41:30 +11:00
Fix typo that broke the GOL!
This commit is contained in:
parent
79c14c51c5
commit
1b06a521d6
|
@ -26,6 +26,12 @@ fn main() {
|
||||||
cells[5 * WIDTH + 11] = true;
|
cells[5 * WIDTH + 11] = true;
|
||||||
cells[5 * WIDTH + 12] = true;
|
cells[5 * WIDTH + 12] = true;
|
||||||
|
|
||||||
|
cells[50 * WIDTH + 50] = true;
|
||||||
|
cells[51 * WIDTH + 51] = true;
|
||||||
|
cells[52 * WIDTH + 49] = true;
|
||||||
|
cells[52 * WIDTH + 50] = true;
|
||||||
|
cells[52 * WIDTH + 51] = true;
|
||||||
|
|
||||||
let mut previous = SystemTime::now();
|
let mut previous = SystemTime::now();
|
||||||
let mut extra_delay: f64 = 0.0;
|
let mut extra_delay: f64 = 0.0;
|
||||||
|
|
||||||
|
@ -129,7 +135,7 @@ fn make_some_babies(cells: &mut [bool], neighbors: &mut [u32]) {
|
||||||
if neighbors[cell] <= 1 {
|
if neighbors[cell] <= 1 {
|
||||||
// die from under population
|
// die from under population
|
||||||
cells[cell] = false;
|
cells[cell] = false;
|
||||||
} else if neighbors[cell] >= 3 {
|
} else if neighbors[cell] > 3 {
|
||||||
// die from over population
|
// die from over population
|
||||||
cells[cell] = false;
|
cells[cell] = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue