Skip to content

Commit

Permalink
moved glider to the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
algobytewise committed Feb 18, 2021
1 parent 98112c6 commit a9e12e3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Cellular-Automata/ConwaysGameOfLife.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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)

0 comments on commit a9e12e3

Please sign in to comment.