Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-04-25 21:52:11 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-04-25 21:52:11 (GMT)
commit0af876941a1a49dd6bf1bf8d01a518268533c044 (patch)
tree611e8de7b2ed8350c3afff761a91bc96da8619e7 /data
parent1e69cccd18c56da2ee8ac65faf2325f584ecc8d4 (diff)
pep8 fixes
Diffstat (limited to 'data')
-rw-r--r--data/graphics/life5
1 files changed, 5 insertions, 0 deletions
diff --git a/data/graphics/life b/data/graphics/life
index 902f345..c6d79cb 100644
--- a/data/graphics/life
+++ b/data/graphics/life
@@ -5,6 +5,7 @@ import os
import time
import random
+
def LoadCells(rows, cols):
""" We need a function to load cells in the neighborhood """
grid = []
@@ -20,6 +21,7 @@ def LoadCells(rows, cols):
grid[x][y] = cell
return grid
+
def DrawGrid(grid):
""" Here we draw the grid """
rows = len(grid)
@@ -32,6 +34,7 @@ def DrawGrid(grid):
print 'o',
print '\n',
+
def CountNeighbors(grid, x, y):
""" Count neighbors arround a single cell"""
@@ -58,6 +61,7 @@ def CountNeighbors(grid, x, y):
return neighbors
+
def Iteration(grid):
""" here we define a single iteration
if we have between 3 and 6 neighbors the single cell lives
@@ -76,6 +80,7 @@ def Iteration(grid):
if neighbors == 3:
grid[x][y] = 1
+
def Iterator(rows, cols, pulses):
""" Iterate n pulses and draws the result of each one """
pulse = 1