#!/usr/bin/perl
print "Content-type:text/html\r\n\r\n";
$ver = "verdana";
$fon = 3;
#'SOUTH'
#this may become a library file for an 'area, 'ie if($south);
##open vocab:
open(TXT, ";
$arrlength = @text; #length of text ie number of lines
print "";
#print "length ".$arrlength;
print ";
close(TXT);
#####requests for drinks sentences:
open(TXT, ";
$drinklength = @drink; #length of text ie number of lines
#print " drink length: ".$drinklength;
close(TXT);
################
#####Duke of Bedford texts:
open(TXT, ";
$bedford_length = @bedford; #length of text ie number of lines
#print ""." bedford length:"."$bedford_length"."
";
close(TXT);
################
#####drunken sentences:
open(TXT, ";
$drink_words_length = @drink_words; #length of text ie number of lines
#print " drink words length: ".$drink_words_length;
close(TXT);
################
$im;
#print "
"."nums ".$arrlength;
#$divider = $arrlength/2;
$num = rand($arrlength);
$numsec = rand($arrlength);
$int2 = int($num);
$int3 = int($numsec);
#print "
"."first random ".$int2." second random: ".$int3;
#$int = int($divider);
$drunk = 0;
$drink_decider = rand(10);
$drink_index = int($drink_decider);
#need variety here:
###first part of story SOUTH
#print "
" ."I know a ".$story[$stor]." about this place. A few years ago a ".$text[$int2].
#print "
" ."I know a ";
print &i_know;
print &storyy;
print " about this place. A few years ago a ".$text[$int2];
print " man walked up The Dip with a large suitcase";
print "
". "he was ".$text[$int3]. "yes, I said ".$text[$int3];
&drink_decider;
#################################
#pick a request for a drink:
sub drink_req
{
$drunk_num = rand($drinklength);
$drink_int = int($drunk_num);
print ". ".$drink[$drink_int];
}
##############################
#how to decide to request drinks, will be based
#on user patterns, has user taken agent to pub?
sub drink_decider{
if($drink_index <5){
&drink_req;
$im = "im2.jpg";
}
if($drink_index >=5){ #not sure this is logical! above and below
$drunk++;
# print $drunk;
&drunken_speak;
$im = "duke.jpg";
}
}
###############################################
#pick a drunken speech conditional to variables above:
sub drunken_speak
{
$drunk_num2 = rand($drink_words_length);
$drink_int2 = int($drunk_num2);
#make this also random and like James Joyce hahah
print "
";
print "
"."You are in the Duke of Bedford, a Victorian pub at the Southern end of The Dip.";
#randomise this: or interchange my vocabualry
print "
"."Lent is quite tipsy, rambling, half finishing his beery sentences.
";
print "\"$drink_words[$drink_int2]\"". " he says, hiccupping "; #randomise hiccupping
print "
";
&bedford;
}
##############################
#bedford stuff:
sub bedford
{
$bed_num = rand($bedford_length);
$bed_int = int($bed_num);
print $bedford[$bed_int];
}
sub storyy{
@story = ("queer thing","strange story","fine mystery", "good story", "story", "thing");
$story_length = @story;
$story_word = rand($story_length);
$stor = int($story_word);
return $story[$stor];
}
sub i_know{
@story = ("I know a ","so there is a ","I suppose you want to hear a ",
"You want to listen to this, I know a ", "would you like to hear a ", "thing is there's a ");
$story_length = @story;
$story_word = rand($story_length);
$stor = int($story_word);
return $story[$stor];
}
print "
";
print << "DOC";
DOC