walk()

Walking animation function for CLI Pets.

walk(pet='🐱', steps=30, speed=0.1)

Animate a pet walking across the terminal.

Parameters:

Name Type Description Default
pet str

Emoji character to display (default: cat)

'🐱'
steps int

Number of steps to take (default: 30)

30
speed float

Seconds between steps (default: 0.1)

0.1
Source code in src\cli_pets\walk.py
 6
 7
 8
 9
10
11
12
13
14
def walk(pet: str = "🐱", steps: int = 30, speed: float = 0.1) -> None:
    """Animate a pet walking across the terminal.

    Args:
        pet: Emoji character to display (default: cat)
        steps: Number of steps to take (default: 30)
        speed: Seconds between steps (default: 0.1)
    """
    race(distance=steps, racers=1, pets=[pet], speed=speed, show_winner=False)