From 2671a30bd78c55e384c4d98efd7b2a74f311be77 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Sun, 7 May 2017 18:48:50 +0200 Subject: [PATCH] removed game of life related stuff --- langton/Main.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/langton/Main.py b/langton/Main.py index 8207b2f..51209cb 100644 --- a/langton/Main.py +++ b/langton/Main.py @@ -110,46 +110,6 @@ def draw(): draw_buffer = [] - -def getNeighborCount(x,y): - count = 0 - - xpn = (x + 1) % livingSpaceWidth - ypn = (y + 1) % livingSpaceHeight - - count += isAlive(x,ypn) - count += isAlive(xpn,ypn) - count += isAlive(xpn,y) - count += isAlive(xpn,y-1) - count += isAlive(x,y-1) - count += isAlive(x-1,y-1) - count += isAlive(x-1,y) - count += isAlive(x-1,ypn) - - return count - -def calculateNextGeneration(): - neighborCount = [] - for column in range(livingSpaceWidth): - neighborCount.append([]) - for row in range(livingSpaceHeight): - neighborCount[column].append(getNeighborCount(column,row)) - - for column in range(livingSpaceWidth): - for row in range(livingSpaceHeight): - if 2 <= neighborCount[column][row] <= 3: - if neighborCount[column][row] == 3: - livingSpace[column][row] = 1000 - if not isAlive(column,row): - livingSpace[column][row] = float(livingSpace[column][row])/1.2 - - else: - livingSpace[column][row] = float(livingSpace[column][row])/1.2 - - if livingSpace[column][row] < 20: - livingSpace[column][row] = 0 - - def activate(i,j): livingSpace[i][j] = 1000 update_queue.append((i,j))