While it boasts so many species of fish, the program doesn’t offer any information on them, a feature that could help a lot those who want to learn new things about underwater life. It runs flawlessly on all Windows versions and, aside from the fact that it provides two different graphics modes – DirectX 9 and OpenGL – it can run basically on both older and newer systems. Most similar screensavers on the market seriously stress up the computer while they’re active and require more or less advanced graphic cards, but Dream Aquarium provides a pretty smooth experience. Last but not least, besides eye-appealing elements, Dream Aquarium also comprises multi-monitor support, which makes it appropriate for experienced users too. What’s more, there are dedicated options to change bubbles speed and even enable the screensaver to work on widescreen monitors, thus fitting any desktop out there. The application allows you to adjust background settings and even change tanks completely, while also comprising multiple fish species to add new ones in the selected tanks. One of the best things about Dream Aquarium is the great amount of customization options, thus letting you not only to manage the fish in your tank, but also change aquarium settings. Dream Aquarium is a highly-configurable Windows screensaver that creates a virtual aquarium on your desktop, comprising multiple species of fish to better simulate underwater life. print ( 'Fish Tank, by Al Sweigart Ctrl-C to quit.', end = '' ) 226. global FISHES, BUBBLERS, BUBBLES, KELP, STEP 221. """Draw the aquarium on the screen.""" 220. for i, kelpSegment in enumerate ( kelp ): 210. # Simulate the kelp waving for one step: 208. if BUBBLES = TOP_EDGE : # Delete bubbles that reach the top. for i in range ( len ( BUBBLES ) - 1, - 1, - 1 ): 204. # Iterate over BUBBLES in reverse because I'm deleting from BUBBLES 202. elif ( diceRoll = 2 ) and ( bubble != RIGHT_EDGE ): 197. # NOTE: Every string in a fish dictionary should be the same length. # (!) Try changing the constants to create a fish tank with only kelp, 31. FRAMES_PER_SECOND = 4 # (!) Try changing this number to 1 or 60. NUM_BUBBLERS = 1 # (!) Try changing this to 0 or 10. NUM_FISH = 10 # (!) Try changing this to 2 or 100. NUM_KELP = 2 # (!) Try changing this to 10. # newline automatically, so reduce the width by one: 24. # We can't print to the last column on Windows without it adding a 23. print ( 'can install by following the instructions at' ) 17. print ( 'This program requires the bext module, which you' ) 16. Similar to ASCIIQuarium or but mine is based on an 4. This increases our frame rate, reduces flickering, and makes for a much more pleasant fish tank animation.ġ. Most of the fish tank program’s output is empty space, so to make the elements move, the clearAquarium() only has to draw ' ' space characters to the places where the fish, kelp, and bubbles currently are. We can speed this up by only drawing characters to the parts of the terminal window that have changed. This would cause a noticeable flicker in the window. If we erased the entire terminal window to redraw its contents with the bext module, we typically would only get about 3 or 4 FPS. The higher the FPS, the more fluid the animated movement appears.ĭrawing to terminal windows is much slower. This gives them a frame rate of 30 or 60 frames per second (FPS). Modern graphical programs often generate animations by erasing their entire window and redrawing it 30 or 60 times a second. The Program in Actionįigure 27-1 show what the output will look like when you run fishtank.py.įigure 27-1: The output of the fish tank program, with several fish, kelp plants, and bubbles How It Works More information about the bext module can be found at. This program uses the bext module and must be run from the Command Prompt or Terminal in order to display correctly. Take a break and enjoy the calm serenity of this software aquarium, or try programming in some virtual sharks to terrorize its inhabitants! You can’t run this program from your IDE or editor. Each time you run the program, it randomly generates the fish using different fish types and colors. Watch your own virtual fish in a virtual fish tank, complete with air bubblers and kelp plants.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |