Skip to content

Commit a9e12e3

Browse files
committed
moved glider to the bottom
1 parent 98112c6 commit a9e12e3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Cellular-Automata/ConwaysGameOfLife.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ The Game of Life is a cellular automaton devised by the British mathematician Jo
1515
* [ [ 0, 0, 0 ], [ 1, 1, 1 ], [ 0, 0, 0 ] ]
1616
*/
1717

18-
// Define glider example
19-
const glider = [
20-
[0, 1, 0, 0, 0, 0, 0, 0],
21-
[0, 0, 1, 0, 0, 0, 0, 0],
22-
[1, 1, 1, 0, 0, 0, 0, 0],
23-
[0, 0, 0, 0, 0, 0, 0, 0],
24-
[0, 0, 0, 0, 0, 0, 0, 0],
25-
[0, 0, 0, 0, 0, 0, 0, 0],
26-
[0, 0, 0, 0, 0, 0, 0, 0],
27-
[0, 0, 0, 0, 0, 0, 0, 0]
28-
]
29-
3018
/*
3119
* Generates the next generation for a given state of Conway's Game of Life.
3220
*/
@@ -87,4 +75,16 @@ async function animate (cells, steps) {
8775
}
8876
}
8977

78+
// Define glider example
79+
const glider = [
80+
[0, 1, 0, 0, 0, 0, 0, 0],
81+
[0, 0, 1, 0, 0, 0, 0, 0],
82+
[1, 1, 1, 0, 0, 0, 0, 0],
83+
[0, 0, 0, 0, 0, 0, 0, 0],
84+
[0, 0, 0, 0, 0, 0, 0, 0],
85+
[0, 0, 0, 0, 0, 0, 0, 0],
86+
[0, 0, 0, 0, 0, 0, 0, 0],
87+
[0, 0, 0, 0, 0, 0, 0, 0]
88+
]
89+
9090
animate(glider, 16)

0 commit comments

Comments
 (0)