Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed May 9, 2018
1 parent 0c99fe2 commit 7faf101
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
18 changes: 0 additions & 18 deletions s126/s126.pyde
Expand Up @@ -11,11 +11,7 @@ from inputs import *
def setup():
global input, GIF_EXPORT
size(600, 600, P2D)
#frameRate(10)
#textAlign(CENTER, CENTER)
noFill()
#frameRate(30)
#strokeWeight(3)
Cell.CELLS = []
GIF_EXPORT = False
# Ask user for Arduino port, uses slider if none is selected`
Expand Down Expand Up @@ -56,13 +52,6 @@ def keyPressed():
def keyReleased():
input.keyReleased()

def rnd_choice(collection):
i = int(random(len(collection)))
return collection[i]

def item_at_x_y(x, y, collenction, width_):
return collection[x + y * width_]

def pointy_hexagon(x, y, r):
with pushMatrix():
translate(x, y)
Expand All @@ -78,7 +67,6 @@ def create_grid():
global GRID_SIDE, RAND_SIZE, SPAC_SIZE
# seize inputs
GRID_SIDE = int(input.analog(1) / 16) # 0 a 63 linhas e colunas na grade
# RAND_SIZE = int(input.analog(2) / 16) # escala a randomização do tamanho
randomSeed(int(input.analog(2)) / 4)
# espaçamento entre os elementos
SPAC_SIZE = int(width / (GRID_SIDE + 0.01))
Expand Down Expand Up @@ -129,12 +117,6 @@ class Cell():

def draw_(self):
self.update_nc()
# if dist(self.x, self.y, mouseX, mouseY) < SPAC_SIZE * 2:
# fill(255)
# text(str(self.nc), self.x, self.y)
# fill(0, 16)
# else:
# noFill()
if self.status:
stroke(self.get_color())
noFill()
Expand Down
20 changes: 3 additions & 17 deletions s127/s127.pyde
Expand Up @@ -11,11 +11,6 @@ from inputs import *
def setup():
global input, GIF_EXPORT
size(600, 600, P2D)
#frameRate(10)
#textAlign(CENTER, CENTER)
noFill()
#frameRate(30)
#strokeWeight(3)
Cell.CELLS = []
GIF_EXPORT = False
# Ask user for Arduino port, uses slider if none is selected`
Expand All @@ -24,8 +19,6 @@ def setup():

def draw():
background(64, 64, 127, 128)
# fill(64, 64, 127, 128)
# rect(0, 0, width, height)

for cell in Cell.CELLS:
cell.draw_()
Expand Down Expand Up @@ -79,7 +72,6 @@ def create_grid():
global GRID_SIDE, RAND_SIZE, SPAC_SIZE
# seize inputs
GRID_SIDE = int(input.analog(1) / 16) # 0 a 63 linhas e colunas na grade
# RAND_SIZE = int(input.analog(2) / 16) # escala a randomização do tamanho
randomSeed(int(input.analog(2)) / 4)
# espaçamento entre os elementos
SPAC_SIZE = int(width / (GRID_SIDE + 0.01))
Expand Down Expand Up @@ -110,12 +102,12 @@ class Cell():

def update_nc(self):
self.nc = self.neighbours()
if self.nc < 2:
if self.nc <= 1: # 1 vizinho só, morre
self.next = 0
elif self.nc > 3:
elif self.nc >= 4: # 4, 5 ou 6 vizinhos, morre
self.next = 0
else:
self.next = 1
self.next = 1 # 2 ou 3 vizinhos, nasce ou persiste

@classmethod
def update(cls):
Expand All @@ -130,12 +122,6 @@ class Cell():

def draw_(self):
self.update_nc()
# if dist(self.x, self.y, mouseX, mouseY) < SPAC_SIZE * 2:
# fill(255)
# text(str(self.nc), self.x, self.y)
# fill(0, 16)
# else:
# noFill()
if self.status:
fill(self.get_color())
noStroke()
Expand Down

0 comments on commit 7faf101

Please sign in to comment.