gif_rename
| 
		 Przed Szerokość: | Wysokość: | Rozmiar: 639 KiB Po Szerokość: | Wysokość: | Rozmiar: 639 KiB  | 
| 
		 Przed Szerokość: | Wysokość: | Rozmiar: 1.1 MiB Po Szerokość: | Wysokość: | Rozmiar: 1.1 MiB  | 
| 
		 Przed Szerokość: | Wysokość: | Rozmiar: 3.0 MiB Po Szerokość: | Wysokość: | Rozmiar: 3.0 MiB  | 
| 
						 | 
				
			
			@ -0,0 +1,50 @@
 | 
			
		|||
# -*- coding: utf-8 -*-
 | 
			
		||||
 | 
			
		||||
ROTATION = {0 : 0,
 | 
			
		||||
            BOTTOM : 0,
 | 
			
		||||
            DOWN : 0,
 | 
			
		||||
            1 : HALF_PI,
 | 
			
		||||
            LEFT : HALF_PI,
 | 
			
		||||
            2 : PI,
 | 
			
		||||
            TOP : PI,
 | 
			
		||||
            UP : PI,
 | 
			
		||||
            3 : PI + HALF_PI,
 | 
			
		||||
            RIGHT: PI + HALF_PI,
 | 
			
		||||
            BOTTOM + RIGHT : 0,
 | 
			
		||||
            DOWN + RIGHT : 0,
 | 
			
		||||
            DOWN + LEFT : HALF_PI,
 | 
			
		||||
            BOTTOM + LEFT : HALF_PI,
 | 
			
		||||
            TOP + LEFT : PI,
 | 
			
		||||
            UP + LEFT : PI,
 | 
			
		||||
            TOP + RIGHT: PI + HALF_PI,
 | 
			
		||||
            UP + RIGHT: PI + HALF_PI,
 | 
			
		||||
            }
 | 
			
		||||
    
 | 
			
		||||
def quarter_circle(x, y, radius, quadrant):
 | 
			
		||||
    circle_arc(x, y, radius, ROTATION[quadrant], HALF_PI)
 | 
			
		||||
 | 
			
		||||
def half_circle(x, y, radius, quadrant):
 | 
			
		||||
    circle_arc(x, y, radius, ROTATION[quadrant], PI)
 | 
			
		||||
 | 
			
		||||
def circle_arc(x, y, radius, start_ang, sweep_ang):
 | 
			
		||||
    arc(x, y, radius * 2, radius * 2, start_ang, start_ang + sweep_ang)
 | 
			
		||||
    
 | 
			
		||||
def bar(x1, y1, x2, y2, thickness=None, shorter=0, ends=(1,1)):
 | 
			
		||||
    """
 | 
			
		||||
    O código para fazer as barras, dois pares (x, y),
 | 
			
		||||
    um parâmetro de encurtamento: shorter
 | 
			
		||||
    """
 | 
			
		||||
    L = dist(x1, y1, x2, y2)
 | 
			
		||||
    if not thickness:
 | 
			
		||||
        thickness = 10
 | 
			
		||||
    with pushMatrix():
 | 
			
		||||
        translate(x1, y1)
 | 
			
		||||
        angle = atan2(x1 - x2, y2 - y1)
 | 
			
		||||
        rotate(angle)
 | 
			
		||||
        offset = shorter / 2
 | 
			
		||||
        line(thickness/2, offset, thickness/2, L - offset)
 | 
			
		||||
        line(-thickness/2, offset, -thickness/2, L - offset)
 | 
			
		||||
        if ends[0]:
 | 
			
		||||
            half_circle(0, offset, thickness/2, UP)
 | 
			
		||||
        if ends[1]:
 | 
			
		||||
            half_circle(0,  L - offset, thickness/2, DOWN)
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,226 @@
 | 
			
		|||
# -*- coding: utf-8 -*-
 | 
			
		||||
from random import choice
 | 
			
		||||
from arcs import quarter_circle, half_circle, circle_arc, bar
 | 
			
		||||
 | 
			
		||||
class Cell():
 | 
			
		||||
    grid = dict()
 | 
			
		||||
    debug_mode = False
 | 
			
		||||
    # constants
 | 
			
		||||
    N, A, I, T, L, C, E = "NAITLCE"
 | 
			
		||||
    types = {"11111": A, # All neighbours on
 | 
			
		||||
             "00100": N, # No neighbours on - isolated
 | 
			
		||||
             "01111": T, # T-shaped (three neighbours)
 | 
			
		||||
             "11110": T,
 | 
			
		||||
             "11101": T,
 | 
			
		||||
             "10111": T,
 | 
			
		||||
             "10101": I, # I - Up & down or Left and Right
 | 
			
		||||
             "01110": I, 
 | 
			
		||||
             "01100": C, # Cap - single neighbour
 | 
			
		||||
             "00110": C,
 | 
			
		||||
             "00101": C,
 | 
			
		||||
             "10100": C,
 | 
			
		||||
             "01101": L, # L-shaped (two neighbours)
 | 
			
		||||
             "10110": L,
 | 
			
		||||
             "00111": L,
 | 
			
		||||
             "11100": L,
 | 
			
		||||
             # "00000": E, # Empty - not used at this point
 | 
			
		||||
             # "10000": E,
 | 
			
		||||
             # "01000": E,
 | 
			
		||||
             # "00010": E
 | 
			
		||||
             }
 | 
			
		||||
 | 
			
		||||
    # 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))
 | 
			
		||||
 | 
			
		||||
    def __init__(self, index, cell_size, state=False, border=None):
 | 
			
		||||
        self.index = index
 | 
			
		||||
        self.state = state
 | 
			
		||||
        self.size_ = cell_size
 | 
			
		||||
        self.mouse_down = False
 | 
			
		||||
        self.variation = choice(("a", "b", "c"))
 | 
			
		||||
        self.ang = choice((0, 1, 2, 3))
 | 
			
		||||
        self.border = border
 | 
			
		||||
        self.calculate_pos()
 | 
			
		||||
 | 
			
		||||
    def calculate_pos(self):
 | 
			
		||||
        i, j = self.index
 | 
			
		||||
        if self.border == None:
 | 
			
		||||
            self.border = self.size_
 | 
			
		||||
        self.pos = PVector(self.border + self.size_ / 2 + i * self.size_,
 | 
			
		||||
                           self.border + self.size_ / 2 + j * self.size_)
 | 
			
		||||
 | 
			
		||||
    def update(self, mx, my):
 | 
			
		||||
        # mouse over & selection treatment
 | 
			
		||||
        hs = self.size_ / 2
 | 
			
		||||
        px, py = self.pos.x, self.pos.y
 | 
			
		||||
        self.mouse_on = (px - hs < mx < px + hs and
 | 
			
		||||
                         py - hs < my < py + hs)
 | 
			
		||||
        if self.mouse_on and mousePressed:
 | 
			
		||||
            self.mouse_down = True
 | 
			
		||||
 | 
			
		||||
        elif self.mouse_down:
 | 
			
		||||
            self.state = not self.state
 | 
			
		||||
            self.mouse_down = False
 | 
			
		||||
 | 
			
		||||
        self.find_type(Cell.ONL)
 | 
			
		||||
 | 
			
		||||
    def plot(self, mode):
 | 
			
		||||
        quarter = self.size_ / 4.  # - 1
 | 
			
		||||
        rnd = choice(("a", "b", "c", "d"))
 | 
			
		||||
        mode_variation = {1: "a",
 | 
			
		||||
                          2: "b",
 | 
			
		||||
                          3: "c",
 | 
			
		||||
                          4: "d",
 | 
			
		||||
                          5: rnd}
 | 
			
		||||
        if self.state:
 | 
			
		||||
            strokeWeight(1)
 | 
			
		||||
            if 1 <= mode <= 5:
 | 
			
		||||
                self.variation = mode_variation[mode]
 | 
			
		||||
            self.draw_node()
 | 
			
		||||
            if mode == -1:
 | 
			
		||||
                fill(100, 100)
 | 
			
		||||
                noStroke()
 | 
			
		||||
                rect(self.pos.x, self.pos.y, self.size_, self.size_)
 | 
			
		||||
                noFill()
 | 
			
		||||
            # diagonal mode
 | 
			
		||||
            if mode == 6:
 | 
			
		||||
                i, j = self.index
 | 
			
		||||
                for (ni, nj) in Cell.DNL:
 | 
			
		||||
                    nb = Cell.grid.get((i + ni, j + nj), None)
 | 
			
		||||
                    if nb and nb.state:
 | 
			
		||||
                        for ii in range(Cell.step_start - 2,
 | 
			
		||||
                                        Cell.step_end - 2,
 | 
			
		||||
                                        Cell.step):  # (-28, 29, 7):
 | 
			
		||||
                            stroke(64 - ii * 8, 128, 64 + ii * 8)
 | 
			
		||||
                            if ni <> 0 and nj <> 0:
 | 
			
		||||
                                bar(self.pos.x, self.pos.y,
 | 
			
		||||
                                    nb.pos.x, nb.pos.y,
 | 
			
		||||
                                    (quarter + ii) * 2, ends=(0, 1))
 | 
			
		||||
                            # else:
 | 
			
		||||
                            #     ellipse(self.pos.x, self.pos.y,
 | 
			
		||||
                            #             (a + ii) * 2, (a + ii) * 2)
 | 
			
		||||
 | 
			
		||||
    def draw_node(self):
 | 
			
		||||
        """ draws node """
 | 
			
		||||
        if Cell.debug_mode:
 | 
			
		||||
            stroke(0, 255, 0)
 | 
			
		||||
            text(Cell.types(self.type), 0, 0)
 | 
			
		||||
        siz = self.size_
 | 
			
		||||
        l = siz / 2.
 | 
			
		||||
        a = l / 2.  # - 1
 | 
			
		||||
        c = l / 2.  # + 1
 | 
			
		||||
        with pushMatrix():
 | 
			
		||||
            translate(self.pos.x, self.pos.y)
 | 
			
		||||
            noFill()  # stroke(0)
 | 
			
		||||
            rotation = {"11110": PI,
 | 
			
		||||
                        "10110": PI,
 | 
			
		||||
                        "00101": PI,
 | 
			
		||||
                        "11101": HALF_PI,
 | 
			
		||||
                        "01110": HALF_PI,
 | 
			
		||||
                        "11100": HALF_PI,
 | 
			
		||||
                        "00110": HALF_PI, 
 | 
			
		||||
                        "11111": HALF_PI * self.ang,
 | 
			
		||||
                        "10111": PI + HALF_PI,
 | 
			
		||||
                        "00111": PI + HALF_PI,
 | 
			
		||||
                        "01100": PI + HALF_PI
 | 
			
		||||
                        }
 | 
			
		||||
            rotate(rotation.get(self.type, 0))
 | 
			
		||||
            
 | 
			
		||||
            for i in range(Cell.step_start,
 | 
			
		||||
                           Cell.step_end,
 | 
			
		||||
                           Cell.step):  # (-28, 29, 7):
 | 
			
		||||
                stroke(8, 64 + i * 8, 64 - i * 8)
 | 
			
		||||
 | 
			
		||||
                if Cell.types[self.type] == Cell.A:
 | 
			
		||||
                    if self.variation in "bd":
 | 
			
		||||
                        quarter_circle(l, l, c + i, TOP + LEFT)
 | 
			
		||||
                        quarter_circle(-l, -l, c + i, BOTTOM + RIGHT)
 | 
			
		||||
                        quarter_circle(-l, l, c + i, TOP + RIGHT)
 | 
			
		||||
                        quarter_circle(l, -l, c + i, BOTTOM + LEFT)
 | 
			
		||||
                    if self.variation == "d":
 | 
			
		||||
                        ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
                    if self.variation == "a":
 | 
			
		||||
                        # ellipse(0, 0, (a + i) * 2, (a + i) * 2)
 | 
			
		||||
                        half_circle(-l, 0, a - i, RIGHT)
 | 
			
		||||
                        half_circle(l, 0, a - i, LEFT)
 | 
			
		||||
                        half_circle(0, l, a - i, TOP)
 | 
			
		||||
                        half_circle(0, -l, a - i, BOTTOM)
 | 
			
		||||
                    if self.variation == "c":
 | 
			
		||||
                        line(+a - i, -l, +a - i, l)
 | 
			
		||||
                        line(-a + i, -l, -a + i, l)
 | 
			
		||||
                        half_circle(-l, 0, a - i, RIGHT)
 | 
			
		||||
                        half_circle(l, 0, a - i, LEFT)
 | 
			
		||||
                        # if keyPressed: ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
 | 
			
		||||
                elif Cell.types[self.type] == Cell.T:
 | 
			
		||||
                    if self.variation in "bd":
 | 
			
		||||
                        line(-l, -a + i, l, -a + i)
 | 
			
		||||
                        quarter_circle(l, l, c + i, TOP + LEFT)
 | 
			
		||||
                        quarter_circle(-l, l, c + i, TOP + RIGHT)
 | 
			
		||||
                    elif self.variation == "c":
 | 
			
		||||
                        half_circle(-l, 0, a - i, RIGHT)
 | 
			
		||||
                        half_circle(l, 0, a - i, LEFT)
 | 
			
		||||
                        half_circle(0, l, a - i, TOP)
 | 
			
		||||
                    if self.variation in "cd":
 | 
			
		||||
                        ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
                    if self.variation == "a":
 | 
			
		||||
                        line(-l, -a + i, l, -a + i)
 | 
			
		||||
                        half_circle(-l, 0, a - i, RIGHT)
 | 
			
		||||
                        half_circle(l, 0, a - i, LEFT)
 | 
			
		||||
                        half_circle(0, l, a - i, TOP)
 | 
			
		||||
 | 
			
		||||
                elif Cell.types[self.type] == Cell.I:
 | 
			
		||||
                    if self.variation == "d":
 | 
			
		||||
                        ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
                    if self.variation in "abd":
 | 
			
		||||
                        line(+a - i, -l, +a - i, l)
 | 
			
		||||
                        line(-a + i, -l, -a + i, l)
 | 
			
		||||
                    if self.variation in "ca":
 | 
			
		||||
                        half_circle(0, l, a - i, TOP)
 | 
			
		||||
                        half_circle(0, -l, a - i, BOTTOM)
 | 
			
		||||
 | 
			
		||||
                elif Cell.types[self.type] == Cell.L:
 | 
			
		||||
                    if self.variation in "a":
 | 
			
		||||
                        quarter_circle(-l, l, siz - c - i, TOP + RIGHT)
 | 
			
		||||
                    elif self.variation == "b":
 | 
			
		||||
                        quarter_circle(-l, l, siz - c - i, TOP + RIGHT)
 | 
			
		||||
                        i *= -1
 | 
			
		||||
                        quarter_circle(-l, l, c - i, TOP + RIGHT)
 | 
			
		||||
                    elif self.variation == "c":
 | 
			
		||||
                        ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
                    if self.variation in "acd":
 | 
			
		||||
                        half_circle(-l, 0, a - i, RIGHT)
 | 
			
		||||
                        half_circle(0, l, a - i, TOP)
 | 
			
		||||
 | 
			
		||||
                elif Cell.types[self.type] == Cell.C:
 | 
			
		||||
                    if self.variation in "ac":
 | 
			
		||||
                        half_circle(0, -l, a - i, BOTTOM)
 | 
			
		||||
                    if self.variation in "ab":
 | 
			
		||||
                        half_circle(0, 0, a - i, BOTTOM)
 | 
			
		||||
                    if self.variation in "abd":
 | 
			
		||||
                        line(+a - i, -l, +a - i, 0)
 | 
			
		||||
                        line(-a + i, -l, -a + i, 0)
 | 
			
		||||
                    if self.variation in "dc":
 | 
			
		||||
                        ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
 | 
			
		||||
                elif Cell.types[self.type] == Cell.N:
 | 
			
		||||
                    ellipse(0, 0, (a - i) * 2, (a - i) * 2)
 | 
			
		||||
 | 
			
		||||
    def find_type(self, nbs):
 | 
			
		||||
        i, j = self.index[0], self.index[1]
 | 
			
		||||
        self.type = ""
 | 
			
		||||
        for (ni, nj) in nbs:
 | 
			
		||||
            nb = Cell.grid.get((i + ni, j + nj), None)
 | 
			
		||||
            if nb and nb.state:
 | 
			
		||||
                self.type += "1"
 | 
			
		||||
            else:
 | 
			
		||||
                self.type += "0"
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
"""
 | 
			
		||||
Alexandre B A Villares http://abav.lugaralgum.com - GPL v3 
 | 
			
		||||
 | 
			
		||||
A helper for the Processing gifAnimation library https://github.com/extrapixel/gif-animation/tree/3.0
 | 
			
		||||
Download from https://github.com/villares/processing-play/blob/master/export_GIF/unzip_and_move_to_libraries_GifAnimation.zip
 | 
			
		||||
This helper was inspired by an example by Art Simon https://github.com/APCSPrinciples/AnimatedGIF/
 | 
			
		||||
 | 
			
		||||
# add at the start of your sketch:
 | 
			
		||||
  add_library('gifAnimation')
 | 
			
		||||
  from gif_exporter import gif_export
 | 
			
		||||
# add at the end of draw():
 | 
			
		||||
  gif_export(GifMaker)
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
def gif_export(GifMaker,             # gets a reference to the library
 | 
			
		||||
               filename="exported",  # .gif will be added
 | 
			
		||||
               repeat=0,             # 0 makes it an "endless" animation
 | 
			
		||||
               quality=255,          # quality range 0 - 255
 | 
			
		||||
               delay=200,            # this is quick
 | 
			
		||||
               frames=0,             # 0 will stop on keyPressed or frameCount >= 100000
 | 
			
		||||
               finish=False):        # force stop
 | 
			
		||||
    global gifExporter
 | 
			
		||||
    try:
 | 
			
		||||
        gifExporter
 | 
			
		||||
    except NameError:
 | 
			
		||||
        gifExporter = GifMaker(this, filename + ".gif")
 | 
			
		||||
        gifExporter.setRepeat(repeat)
 | 
			
		||||
        gifExporter.setQuality(quality)
 | 
			
		||||
        gifExporter.setDelay(delay)
 | 
			
		||||
        
 | 
			
		||||
    gifExporter.addFrame()
 | 
			
		||||
 | 
			
		||||
    if frames == 0:
 | 
			
		||||
       if keyPressed and key == "e":
 | 
			
		||||
           finish = True
 | 
			
		||||
                
 | 
			
		||||
    if finish:
 | 
			
		||||
        gifExporter.finish()
 | 
			
		||||
        print("gif saved")
 | 
			
		||||
        exit()
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,109 @@
 | 
			
		|||
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
 | 
			
		||||
SKETCH_NAME = "sketch_19013a" # find sketch name yourself!
 | 
			
		||||
# refactoring to create module rotation dict
 | 
			
		||||
 | 
			
		||||
OUTPUT = ".gif"
 | 
			
		||||
mode = 0
 | 
			
		||||
save_frame = False
 | 
			
		||||
 | 
			
		||||
from cell import Cell
 | 
			
		||||
from random import choice
 | 
			
		||||
add_library('GifAnimation')
 | 
			
		||||
from gif_exporter import gif_export
 | 
			
		||||
 | 
			
		||||
CELL_SIZE = 25
 | 
			
		||||
Cell.step_start = -3
 | 
			
		||||
Cell.step_end = 4
 | 
			
		||||
Cell.step = 3
 | 
			
		||||
modulus = 3
 | 
			
		||||
 | 
			
		||||
def setup():
 | 
			
		||||
    size(500, 500)
 | 
			
		||||
    global grid_size
 | 
			
		||||
    grid_size = width / CELL_SIZE
 | 
			
		||||
    rectMode(CENTER)
 | 
			
		||||
    strokeCap(SQUARE)
 | 
			
		||||
 | 
			
		||||
def init_grid(f=None):
 | 
			
		||||
    # default grid is with random state for cells
 | 
			
		||||
    if f == None:
 | 
			
		||||
        f = lambda i, j: choice((True, False))
 | 
			
		||||
    # number of collums and rows -2 for default cell sized border    
 | 
			
		||||
    w = int(width // CELL_SIZE) #- 2
 | 
			
		||||
    h = int(height // CELL_SIZE) #- 2
 | 
			
		||||
    for i in range(w):
 | 
			
		||||
        for j in range(h):
 | 
			
		||||
            # default Cell constructor has border=CELL_SIZE
 | 
			
		||||
            Cell.grid[(i, j)] = Cell((i, j), CELL_SIZE, f(i, j), border=0) 
 | 
			
		||||
 | 
			
		||||
def draw():
 | 
			
		||||
    global save_frame
 | 
			
		||||
    background(200)
 | 
			
		||||
    for c in Cell.grid.values():
 | 
			
		||||
        c.update(mouseX, mouseY)
 | 
			
		||||
    for c in Cell.grid.values():
 | 
			
		||||
        c.plot(mode)
 | 
			
		||||
 | 
			
		||||
    if save_frame:
 | 
			
		||||
         save_frame = False
 | 
			
		||||
         gif_export(GifMaker, SKETCH_NAME)
 | 
			
		||||
 | 
			
		||||
def keyPressed():
 | 
			
		||||
    global mode, modulus, save_frame
 | 
			
		||||
    if key == "g" or key == "G":
 | 
			
		||||
        save_frame = True
 | 
			
		||||
    if key == "s" or key == "S":
 | 
			
		||||
        saveFrame(SKETCH_NAME + "_#######.png")
 | 
			
		||||
    if key != CODED and key in "01234567789":
 | 
			
		||||
        mode = int(key)
 | 
			
		||||
    if key == "-":
 | 
			
		||||
        mode = -1
 | 
			
		||||
    if key == " ":
 | 
			
		||||
        t = lambda i, j: True
 | 
			
		||||
        f = lambda i, j: False
 | 
			
		||||
        init_grid(choice((t, f)))
 | 
			
		||||
    if key == "r":
 | 
			
		||||
        init_grid()
 | 
			
		||||
    if key == "x":
 | 
			
		||||
        init_grid(lambda i, j: (i + j) % modulus)
 | 
			
		||||
    if key == "<" and modulus > 2:
 | 
			
		||||
        modulus -= 1
 | 
			
		||||
    if key == ">":
 | 
			
		||||
        modulus += 1
 | 
			
		||||
    if key == "z":
 | 
			
		||||
        move_grid()
 | 
			
		||||
    if keyCode == RIGHT:
 | 
			
		||||
        move_grid(x=1, y=0)
 | 
			
		||||
    if keyCode == LEFT:
 | 
			
		||||
        move_grid(x=-1, y=0)
 | 
			
		||||
    if keyCode == UP:
 | 
			
		||||
        move_grid(x=0, y=-1)
 | 
			
		||||
    if keyCode == DOWN:
 | 
			
		||||
        move_grid(x=0, y=1)
 | 
			
		||||
 | 
			
		||||
def move_grid(x=1, y=1):
 | 
			
		||||
    w, h = width // CELL_SIZE, height // CELL_SIZE
 | 
			
		||||
    new_grid = dict()
 | 
			
		||||
    for i in range(w):
 | 
			
		||||
        for j in range(h):
 | 
			
		||||
            c = Cell.grid.get((i, j), None)
 | 
			
		||||
            if c:
 | 
			
		||||
                c.index = ((i + x) % w, (j + y) % h)
 | 
			
		||||
                c.calculate_pos()
 | 
			
		||||
                new_grid[c.index] = c
 | 
			
		||||
            # else:
 | 
			
		||||
            #     f = lambda i, j: choice((True, False))
 | 
			
		||||
            #     new_grid[(i, j)] = Cell((i, j), CELL_SIZE, f(i, j))
 | 
			
		||||
                
 | 
			
		||||
    Cell.grid = new_grid
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# print text to add to the project's README.md
 | 
			
		||||
def settings():
 | 
			
		||||
    println(
 | 
			
		||||
        """
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
[{0}](https://github.com/villares/sketch-a-day/tree/master/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
 | 
			
		||||
""".format(SKETCH_NAME,OUTPUT)
 | 
			
		||||
    )
 | 
			
		||||
| 
		 Po Szerokość: | Wysokość: | Rozmiar: 3.0 MiB  |