(no title)
c0nstantine | 1 year ago
https://c0stya.github.io/articles/game_of_life.html
### The code ###
import numpy as np
from scipy.signal import convolve2d
field = np.random.randint(0, 2, size=(100, 100)) # 100x100 field size
kernel = np.ones((3, 3))
for i in range(1000): # 1000 steps
new_field = convolve2d(field, kernel, mode="same")
field = (new_field == 3) + (new_field == 4) * field
jononor|1 year ago