#69 Snail Race

You won’t be able to handle the fast-paced excitement of these racing . . . snails. But what they lack in speed they make up for in ASCII-art cuteness. Each snail (represented by an @ character for the shell and v for the two eyestalks) moves slowly but surely toward the finish line. Up to eight snails, each with a custom name, can race each other, leaving a slime trail in their wake. This program is good for beginners.

The Program in Action

When you run snailrace.py, the output will look like this:

Snail Race, by Al Sweigart al@inventwithpython.com

    @v <-- snail

How many snails will race? Max: 8
> 3 Enter snail #1's name: ...

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.