Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created July 31, 2021 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/0840f38bb3a75c4f3aa5f225e61cb076 to your computer and use it in GitHub Desktop.
Save YonatanKra/0840f38bb3a75c4f3aa5f225e61cb076 to your computer and use it in GitHub Desktop.
const matrices = {
last: null,
current: null
};
matrices.current = new Array(MATRIX_DIMENSIONS.height).fill(0)
.map(() => {
return generateWhiteNoise(MATRIX_DIMENSIONS.width, WHITE_LEVEL);
});
while (areMatricesDifferent(matrices.current, matrices.last) || someCounter > someLimit) {
matrices.last = matrices.current;
matrices.current = cellularAutomaton(matrices.last);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment