#36 Hourglass
This visualization program has a rough physics engine that simulates sand falling through the small aperture of an hourglass. The sand piles up in the bottom half of the hourglass; then the hourglass is turned over so the process repeats.
The Program in Action
Figure 36-1 shows what the output will look like when you run hourglass.py.
How It Works
The hourglass program implements a rudimentary physics engine. A physics engine is software that simulates physical ...
Get The Big Book of Small Python Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.