Listing 2. Beginning of the main function.

int main(){
  allegro_init();
  install_keyboard();
  set_color_depth(32);
  set_gfx_mode(GFX_AUTODETECT_WINDOWED,width,height,0,0);

  //Seed the random number generator and set the initial
  // direction based on a random number.
  srand(time(NULL));
  dir = rand() % 4;