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:
Freezed 2020-07-16 10:17:18 +02:00
parent 7a8a0945c6
commit ff479a6fe2
1 changed files with 1 additions and 3 deletions

View File

@ -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