Hacker News new | ask | show | jobs
Show HN: How many rain drops to cover a pavement? [Simulation] (charbz.com)
4 points by charbz 3584 days ago
1 comments

Nice simulation and throwing in that you know how trees work.

The embedded me would have brute forced it and gone with setting a double variable to 0x03FFFFFFFFFFFF then turning a bit off when that section was covered. When the variable was zero, pavement covered.

In a more fancy version I'd gone with an array to match the pavement length set to zero and incremented each pavement section by 1 to count the drops in each section. Scan each time to find the first zero, if found more rain, if no zeros then done. That would give a bonus, after the simulation ran I could get a histogram of how many raindrops per section.