人生游戏:我想改变一些事情

问题描述

def next_turn():
    global tab,tab2,x,y,test
    test = test + 1
    tab2 = [[0 for i in range(10)] for j in range(10)]

    for y in range(10):
        for x in range(10):
            compter_cellules_voisines(y,x)

    tab = tab2
    adapte_dessin()
 

# Boutons sur la fenêtre pour faire un tour suivant sur la grille et pour nettoyer la grille 
clr = Button(fen,text = 'Nettoyer le plateau',command = clear)
clr.pack(side = RIGHT,padx = 20,pady = 200)
 
etape = Button(fen,text = 'Tour suivant',command = next_turn)
etape.pack(side = RIGHT,padx = 10)
 
creation_lignes()
Canevas.bind('<Button-1>',Clic)
creer_tableau()

fen.mainloop()

我在 Game of Life 中使用这种方法,但我想自动化这些步骤。我试图更改 next_step 但它不起作用。 你能帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)