This Python application mimics the action of an hourglass. Sand and walls are created with ASCII characters. When the sand drops through the hourglass form, it gets narrower.
- Installing and Running
- How to Use
- License
- How to Contribute
- Additional Points
- Conclusion
You must have Python3 installed on your system in order to use this code. You can carry out the following steps to execute the program:
- Copy or download the hourglass.py file.
- Launch a command prompt or terminal and go to the directory where the file is kept.
- Execute the python3 hourglass.py program.
An hourglass will show up on the screen once you launch the script. The sand will instantly begin to fall. As long as you don't press Ctrl-C to end the application, it will keep running.
The MIT License applies to this program.
Please do the following actions if you would want to contribute to this program:
- Fork the repository on GitHub.
- Make your changes to the code.
- Submit a pull request.
By modifying the PAUSE LENGTH constant at the file's top, you may alter how quickly the sand is falling. The WIDE FALL CHANCE constant can be used to change the likelihood of the sand falling wider. The application makes use of the "bext" module to output colors to the console and control the cursor. This program was written in Python3.
This script is an entertaining way to view a straightforward hourglass simulation. You are welcome to change and enhance the code as you see appropriate!