One-dimensional cellular automata: Difference between revisions

Content added Content deleted
Line 3,133: Line 3,133:
def (gen l)
def (gen l)
uca+collect+for i 0 (i < len.l) ++i
uca+collect+for i 0 (i < len.l) ++i
yield (next (l i-1) l.i (l i+1))
yield (next (l i-1) l.i (l i+1))


# next state of b, given neighbors a and c
# next state of b, given neighbors a and c