Change approach global instead local
1st idea was to manage propagation cells after cells. But this looks to generate a chain reaction that I cannot manage in a function. New idea is to manage the whole pile : * add a grain * find cells that reached 4 * change cell & update neighbors * find cells that reached 4 * change cell & update neighbors
This commit is contained in:
parent
7a8a0945c6
commit
ff479a6fe2
|
@ -39,9 +39,7 @@ def main(pile, n):
|
|||
|
||||
while n != 0:
|
||||
|
||||
if pile[center][center] < 3:
|
||||
pile[center][center] += 1
|
||||
|
||||
pile[center][center] += 1
|
||||
n -= 1
|
||||
|
||||
return pile
|
||||
|
|
Loading…
Reference in New Issue