#!/usr/bin/perl

# Define Variables
$basedir = "http://mnstats.morris.umn.edu/courses/math1601/cgi-bin/dice/picts/";
@images = 
("die1sn.gif","die2s.gif","die3s.gif","die4s.gif","die5s.gif","die6s.gif");
@alt = ("one","two","three","four","five","six");

# Done
##############################################################################

srand(time ^ $$);
$num = rand(@images); # Pick a Random Number

# Print Out Header With Random Filename and Base Directory
print "Content-type: text/html\n\n";

print "<img src=\"$basedir$images[$num]\"";
if ($alt[$num] ne "") {
   print " alt=\"$alt[$num]\"";
}

print "\n";
