Beispiel #1
0
def update():
    global grid_view
    grid_view.delete(ALL)
    model.next_gen()
    for i in range(0, model.height):
        for j in range(0, model.width):
            if model.grid_model[i][j] == 1:
                draw_cell(i, j, 'red')
    if (is_running):
        root.after(10, update)
Beispiel #2
0
def update():
   global grid_view

   grid_view.delete(ALL)

   model.next_gen()
   for i in range(0, model.height):
       for j in range(0, model.width):
           if model.grid_model[i][j] == 1:
                draw_cell(i, j, 'black')
Beispiel #3
0
def update():
    global grid_view, root, is_running

    grid_view.delete(ALL)
    model.next_gen()
    for i in range(0, model.height):
        for j in range(0, model.width):
            if model.grid_model[i][j] == 1:
                draw_cell(i, j, "black")
    if is_running:
        root.after(100, update)
Beispiel #4
0
def update():
    global grid_view, root, is_running
    grid_view.delete(ALL)

    model.next_gen()
    for i in range(0, model.altura):
        for j in range(0, model.largura):
            if model.modelo_de_grade[i][j] == 1:
                draw_cell(i, j, 'black')
    if is_running:
        root.after(100, update)
Beispiel #5
0
def update():
    ##root is a global variable as you are modifying it.
    global grid_view, root, is_running
    ##Clear the canvas before drawing the next generation.
    grid_view.delete(ALL)

    model.next_gen()
    for i in range(0, model.height):
        for j in range(0, model.width):
            if model.grid_model[i][j] == 1:
                draw_cell(i, j, 'black')
    if (is_running):
        root.after(100, update)