wip optimizing render
This commit is contained in:
@ -91,6 +91,15 @@ function conwayRules(cell, neighbors) {
|
||||
return cell;
|
||||
}
|
||||
|
||||
// Get the next evolution of a cell according to
|
||||
// Conway's game of life rules
|
||||
function servietteRules(cell, neighbors) {
|
||||
// loneliness rule
|
||||
if (cell === 0 && [2, 3, 4].find((x) => x == neighbors)) return 1;
|
||||
// the cell remains the same if none apply
|
||||
return 0;
|
||||
}
|
||||
|
||||
// variation of the game of life where a
|
||||
// cell comes to live if 6 neigbor cells are alive
|
||||
function highLifeRules(cell, neighbors) {
|
||||
@ -200,6 +209,7 @@ export {
|
||||
lonelinessRules,
|
||||
threebornRules,
|
||||
highLifeRules,
|
||||
servietteRules,
|
||||
evolve1d,
|
||||
evolve2d,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user