Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import matplotlib.pyplot as plt
import mpmath
import random
def rule30(S):
L = np.roll(S, 1)
C = S
R = np.roll(S, -1)
return np.bitwise_xor(L, np.bitwise_or(C, R))