moved glider to the bottom

This commit is contained in:
algobytewise
2021-02-18 18:46:42 +05:30
parent 98112c6178
commit a9e12e3b98

View File

@ -15,18 +15,6 @@ The Game of Life is a cellular automaton devised by the British mathematician Jo
* [ [ 0, 0, 0 ], [ 1, 1, 1 ], [ 0, 0, 0 ] ]
*/
// Define glider example
const glider = [
[0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 0, 0],
[1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]
]
/*
* Generates the next generation for a given state of Conway's Game of Life.
*/
@ -87,4 +75,16 @@ async function animate (cells, steps) {
}
}
// Define glider example
const glider = [
[0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 0, 0],
[1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]
]
animate(glider, 16)