Commit Graph

7 Commits

Author SHA1 Message Date
Freezed 0bd7ff72b0 Refactor propagation in a function
That's better! I want more test cases to check my algorythm !
2020-07-16 12:37:47 +02:00
Freezed 2119783dad Update neighbors cells
Propation is right for small iteration and/or pile with low grain rate.
For pile with high grain rate, the main while loop is not enough to make propagation
in all cells
2020-07-16 12:11:13 +02:00
Freezed eebd2751fe Update only drop cell
Structure for pile walking to find cells greater than 3 is set

I do not update neighbors cells, then only central value of the pile (where the
sand grain is dropped) is at the right value in the end
2020-07-16 12:11:13 +02:00
Freezed ff479a6fe2 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
2020-07-16 12:11:13 +02:00
Freezed 7a8a0945c6 Drop sand grains without propagation 2020-07-16 12:11:13 +02:00
Freezed 9bf58c7cef Find id for pile center 2020-07-16 12:11:13 +02:00
Freezed cb3c5623ae Add specs for `sand_grain_drop.py` 2020-07-16 12:11:13 +02:00