#22 Ducklings
This program creates a scrolling field of ducklings. Each duckling has slight variations: they can face left or right and have two different body sizes, four types of eyes, two types of mouths, and three positions for their wings. This gives us 96 different possible variations, which the Ducklings program produces endlessly.
The Program in Action
When you run ducklings.py, the output will look like this:
Duckling Screensaver, by Al Sweigart al@inventwithpython.com Press Ctrl-C to quit... =" ) =") ( v)=") ( ^) ^ ^ ( v) >'') ^^ ^^ ( ^) >") ^ ^ ( v) =^^) ("< ("< >") ^^ ( >) (^ ) (< ) ( ^) ^ ^ ^^ ^^ ("< ^^ (``<>^^) (^^= (^ ) (< ...
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.