TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: How many rain drops to cover a pavement? [Simulation]

4 pointsby charbzover 8 years ago

1 comment

AstroJetsonover 8 years ago
Nice simulation and throwing in that you know how trees work.<p>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.<p>In a more fancy version I&#x27;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.