diff CircularCA.py @ 43:6cd37534c12e

Chapter 6, exercise 3: exploring rule 110 cellular automata.
author Brian Neal <bgneal@gmail.com>
date Mon, 14 Jan 2013 20:41:41 -0600
parents 039249efe42f
children
line wrap: on
line diff
--- a/CircularCA.py	Sun Jan 13 16:24:00 2013 -0600
+++ b/CircularCA.py	Mon Jan 14 20:41:41 2013 -0600
@@ -34,6 +34,11 @@
         self.array[0, 1] = 1
         self.next = 1
 
+    def start_row(self, row):
+        """Set the first row to row and set next to 1."""
+        self.array[0, :] = row
+        self.next = 1
+
     def step(self):
         """Executes one time step by computing the next row of the array."""
         i = self.next