#!C:/perl/bin/perl.exe use CGI::Carp qw(fatalsToBrowser); use CGI; $query = new CGI; $v01= $query->param('v01'); $v02= $query->param('v02'); $v03= $query->param('v03'); $v04= $query->param('v04'); $v05= $query->param('v05'); $v06= $query->param('v06'); $pass= $query->param('pass'); if($pass < 1) { $pass = 0; } ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = 1900 + $year; $mon= $mon+1; $hour = $hour - 1; $date1= "$mon/$mday/$year"; $date2= "$hour:$min:$sec"; print $query->header; print $query->start_html(-title=>'Homework 6'); print ""; @animal = (Seadragon, Monkey, Hagfish, Bear, Rabbit, Panda, Armadillo, Marmot, Lizard, Narwhal, Bat, Alpaca, Platypus, Crab, Doggie); @vegetable = (Broccoli, Cauliflower, Artichoke, Beans, Spaghetti, Avocado, Alfalfa, Turnips, Beets, Shallots, Garlic, Cucumber, Eggplant, Okra, Asparagus); @bodypart = (-face, -eye, -cheeks, -arm, -leg, -hand, -chest, -knee, -toe, -ankle, -foot, -neck, -chin, -nose, -ears); @verb = (-eater, -licker, -harasser, -twister, -defenestrater, -wiggler, -melter, -grower, -dancer, -smeller, -jumper, -stomper, -spinner, -puncher, -tripper); if ($pass == 1) { @condition = &randomize(0,1); @numbers1 = &randomize(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); @numbers2 = &randomize(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); $v04 = length($v01) - 1; $v05 = length($v02) - 1; $v06 = length($v03) - 1; if ($condition[0] == 0) { $name1 = $animal[$v04] . $bodypart[$numbers1[0]]; $name2 = $vegetable[$v06] . $verb[$numbers2[0]]; } if ($condition[0] == 1) { $name1 = $vegetable[$v04] . $bodypart[$numbers1[0]]; $name2 = $animal[$v06] . $verb[$numbers2[0]]; } print "Eeks! You've become the infamous $name1 $name2 !!!
"; print "Children and small animals flee from you in horror :(

"; print "The Horror!

"; print "Return to Hepler Labs\n"; } if ($pass == 0) { print "
Mutant Gangster Name Generator!


"; print "
Manbearpig


"; print "Have you ever thought to yourself, 'Hey! I wonder what my gangster name would be in a post-apocalyptic world ravaged by weird, unsightly mutations?'

"; print "Well I sure have!

"; print "Enter your name below to find out what mutation-based moniker you’d be stuck with for the rest of your days!

"; print "
"; print "First Name "; print "Middle Name "; print "Last Name "; print ""; print ""; print "
"; } print $query->end_html; #Randomizes the elements of an array and returns the new array sub randomize { srand; my(@new) = (); while (@_) { push(@new, splice(@_, rand @_,1)); } return @new; }