From 92bd24a4b268e93cf89ec35bae8701b27f03436d Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares Date: Thu, 13 Dec 2018 22:34:11 -0200 Subject: [PATCH] 349_fix --- s349/cell.py | 27 +++++++++++++-------------- s349/s349.pyde | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/s349/cell.py b/s349/cell.py index c5509dcf..1af54fbf 100644 --- a/s349/cell.py +++ b/s349/cell.py @@ -1,15 +1,15 @@ - +1 class Cell(): # neighbours list - NL = ((-1, -1), (+0, -1), (+1, -1), - (-1, +0), (+0, +0), (+1, +0), - (-1, +1), (+0, +1), (+1, +1)) - ONL = ((+0, -1), - (-1, +0), (+0, +0), (+1, +0), - (+0, +1)) - DNL = ((-1, -1), (+1, -1), - (+0, +0), - (-1, +1), (+1, +1)) + NL = ((-1, -1), (0, -1), (1, -1), + (-1, 0), (0, 0), (1, 0), + (-1, 1), (0, 1), (1, 1)) + ONL = ( (0, -1), + (-1, 0), (0, 0), (1, 0), + (0, 1)) + DNL = ((-1, -1), (1, -1), + (0, 0), + (-1, 1), (1, 1)) def __init__(self, index, cell_size, state=False): self.index = index @@ -49,7 +49,6 @@ class Cell(): if mode == 0: stroke(0) self.draw_lines(Cell.NL) - self.draw_lines(Cell.NL) elif mode == 1: stroke(0, 150, 0) self.draw_lines(Cell.ONL) @@ -74,10 +73,10 @@ class Cell(): for (ni, nj) in nbs: nb = Cell.grid.get((i + ni, j + nj), None) if nb and nb.state: - for i in range(3): - s = (third + i * third) + for si in range(3): + s = (third + si * third) ellipse(self.pos.x + ni * third * 1.5, - self.pos.y + nj * third * 1.5, + self.pos.y + nj * third * 1.5, s, s) #point(self.pos.x, self.pos.y) #, third, third) ellipse(self.pos.x, self.pos.y, s, s) diff --git a/s349/s349.pyde b/s349/s349.pyde index a9183053..4ce259b5 100644 --- a/s349/s349.pyde +++ b/s349/s349.pyde @@ -1,5 +1,5 @@ # Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day -SKETCH_NAME = "s349b" # 20181213 +SKETCH_NAME = "s349" # 20181213 OUTPUT = ".png" mode = 0