Set a random initial direction of motion

After seeding the random number generator in Listing 2,

This value is assigned to the variable named dir