From 0af876941a1a49dd6bf1bf8d01a518268533c044 Mon Sep 17 00:00:00 2001 From: Rafael Ortiz Date: Mon, 25 Apr 2011 21:52:11 +0000 Subject: pep8 fixes --- (limited to 'data') 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 -- cgit v0.9.1