C, 71
Assuming that seeding the rand() function is not required.
k=30;main(i){i=rand()%k;while(k--)printf("%*c\n",i+=rand()%2?1:-1,46);} Assuming that seeding the rand() function is not required.
k=30;main(i){i=rand()%k;while(k--)printf("%*c\n",i+=rand()%2?1:-1,46);}