#!/usr/bin/perl
print "Content-type:text/html\r\n\r\n";
require "drunk.lib";
$ver = "verdana";
$fon = 3;
$mess;
$im;
####
$lent_happy = 0;
########location booleans
$location;
$pub;
$north;
$south;
$west;
$easto = 0;
############
#'SOUTH'
#this may become a library file for an 'area, 'ie if($south);
##open vocab:
#length of text ie number of lines
print "";
#print "length ".$arrlength;
print ";
print "
HINTS: if you want to go to the pub, write \"go to pub\"
";
print "if you want to go to the north or south,write \"go north\" etc
";
print "
";
# print "
Lent will ask you all the time to go to the pub";
print "
";
print "
";
################
$im;
print "
";
read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
# Get the name and value for each form input:
@pairs = split(/&/, $FormData);
# Then for each name/value pair....
foreach $pair (@pairs) {
# Separate the name and value:
($name, $value) = split(/=/, $pair);
# Convert + signs to spaces:
$value =~ tr/+/ /;
# Convert hex pairs (%HH) to ASCII characters:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# Store values in a hash called %FORM:
$FORM{$name} = $value;
}
#print "The following text was entered in the e text field: $FORM{'textfield'}";
#print "The hidden text is: $FORM{'hiddenfield'}";
print "
";
# print "The hidden text is: $FORM{'hiddenfield2'}";
$val = "$FORM{'textfield'}";
$easto = "$FORM{'hiddenfield'}";
$lent_happy = "$FORM{'hiddenfield3'}";
#print "
"."thi sis val ".$val;
# print "
".$hello;
if($val =~ m/North/i){ $easto = 0;
$im = "north.jpg";
&drink_req;
print "
";
$location = "north";
$mess = "you are now in the Northern part of the Dip.
";
print "
.There are a few good stories I know about this aprt of the Dip";
}
if($val =~ m/east/i){
$im = "east.jpg";
$easto++;
print "east value = ".$easto;
$location = "east";
&drink_req;
print "
";
$mess = "you are now in the Eastern part of the Dip";
print $mess;
&east_one;
}
if(($location =~ m/east/i)&&($easto >=2 )){
print "
"."already in east, this isnt siberia";
print "
"."any further east and you'll be in Brick Lane";
}
if($val =~ m/west/i){
$im = "west.jpg";
$easto = 0;
$location = "west";
&drink_req;
print "
";
print "you are now in the Western part of the Dip";
}
if($val =~ m/south/i){ $easto = 0;
$im = "south.jpg";
$pic = "south";
$location = "south";
&drink_req;
print "
";
$mess = "you are now in the southern end of the Dip";
print $mess;
}
if($val =~ m/pub/i){ $easto =0;
$im = "duke.jpg";
$pic = "south";
$pub = true;
$location = "pub";
$lent_happy++;
#$mess = "you are now in the Duke of Bedford pub";
&drunken_speak;
print $mess;
}
######### location conditionals
print << "DOC";
DOC
print "
";
print "LOCATION:$location";
print "
.Lent alcohol index: $lent_happy";