Drop sand grains without propagation

This commit is contained in:
Freezed 2020-07-16 09:48:31 +02:00
parent 9bf58c7cef
commit 7a8a0945c6
1 changed files with 8 additions and 1 deletions

View File

@ -37,7 +37,14 @@ def main(pile, n):
center = int((len(pile) - 1) / 2)
return center
while n != 0:
if pile[center][center] < 3:
pile[center][center] += 1
n -= 1
return pile
if __name__ == "__main__":