Introducing the Critter Caretaker Program


The Critter Caretaker program charges the user with the care of his or her own virtual pet. The user names the critter and is completely responsible for keeping it happy, which is no small task. The user must feed and play with the critter to keep it in a good mood. The user can listen to the critter to learn how the critter is feeling, which can range from happy to mad. Figures 8.1 through 8.3 show off the Critter program.

click to expand
Figure 8.1: You get to name your very own critter.

click to expand
Figure 8.2: If you fail to feed or entertain your critter, it will have a mood change for the worse.

click to expand
Figure 8.3: But with the proper care, your critter will come back to its original, sunny mood.

Though you could create this program without software objects, I created the critter as an object. Ultimately, this makes the program easier to work with and modify. Plus, it allows for painless scaling. Once you've created one critter, it's no sweat to create and manage a dozen. Could a critter farm be far off? (Not if you check the chapter challenges.)




Python Programming for the Absolute Beginner
Python Programming for the Absolute Beginner, 3rd Edition
ISBN: 1435455002
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net