#!/usr/bin/perl print "Content-type:text/html\r\n\r\n"; $ver = "verdana"; $fon = 3; print ""; ############################################################################################ #ONTOLOGY OF EVENTS, AGENTS and LOCATIONS could have a menu for users to choose scenarios ########################################################################################## #################CALL FUNCTIONS GRT ORDER RIGHT! &event("stole"); &agent("woman", "boy"); #first and second actor &places("supermarket"); ########################### #need other rules for second agent? #################################### sub places { $place = $_[0] ; if ($place eq "bakery") { #print "man" ; &bakery; }; if ($place eq "pub") { #print "woman"; &pub; }; if ($place eq "supermarket") { #print "girl"; &supermarket; }; if ($place eq "cibaa cafe") { &cibaa_cafe; }; } ############################# sub agent { $agent = $_[0] ; $agent2 = $_[1] ; if ($agent eq "man") { #print "man" ; $actor = "man"; &man; }; if ($agent eq "woman") { #print "woman"; $actor = "woman"; &woman; }; if ($agent eq "girl") { #print "girl"; $actor = "girl"; &girl; }; if ($agent eq "boy") { $actor = "boy"; &boy; }; if ($agent eq "group") { $actor = "group"; &group; }; if ($agent eq "organistaion") { $actor = "organisation"; &organisation; } ###### if ($agent2 eq "man") { #print "man" ; $actor2 = "man"; #&man; }; if ($agent2 eq "woman") { #print "woman"; $actor2 = "woman"; #&woman; }; if ($agent2 eq "girl") { #print "girl"; $actor2 = "girl"; #&girl; }; if ($agent2 eq "boy") { $actor2 = "boy"; #&boy; }; if ($agent2 eq "group") { $actor2 = "group"; #&group; }; if ($agent2 eq "organistaion") { $actor2 = "organisation"; #&organisation; } } ################################## ########################## #************************ ##########################EVENTS sub event{ $event = $_[0] ; #print $_[0]; #$_[1] = $agent; if ($event eq "stole") { #print "stole" ; $event = "and a theft "; $ev = "theft"; &stole; }; if ($event eq "and a desire") { #print "desired"; $event = "desired. "; $ev = "desire"; &desired; }; if ($event eq "hurt") { #print "hurt"; $ev = "hurt"; $event = "and hurt. "; &hurt; }; if ($event eq "enjoyed") { #print "enjoyed"; $ev = "enjoyment"; $event = "and enjoyment. "; &enjoyed; }; if ($event eq "hatred") { #print "hated"; $ev = "hatred"; $event = "and hatred "; &hated; }; if ($event eq "destroyed") { #print "destroyed"; $ev = "destruction"; $event = "and detruction. "; &destroyed; } } ########################## #************************ ####################################################### ##EVENT FUNCTIONS called by 'event' function ######################################################### sub stole{ print " This is a "; print &story1; print" about a theft."; $stor = " This is a story about a theft."; } ################################### sub desired{ print " This is a story about a desire "; $stor = " This is a story about desire."; } #################################### sub hurt{ print " This is a story about hurt. "; $stor = " This is a story about someone getting hurt. "; } ##################################### sub enjoyed{ print " This is story about enjoyment. "; $stor = " This is a story about someone enjoying themselves."; } ################################### sub hated{ print " This is a story about hate. "; $stor = " This is a story about hate."; } ################################ sub destroyed{ print " This is a story about destruction. "; $stor = " This is a story about destruction. "; } ########################## #************************ ########################## ##SET ACTOR and event: sub man { print " This is a story about a man $event. "; } ###################### sub woman { print " This is a "; print &story1; print " about a woman $event. "; } ############# sub girl { print " This is a story about a girl $event. "; } ###################### sub boy { print " This is a story about a boy $event. "; } ############# sub organisation { print " This is a "; print &story1; print " story about an organisation $event. "; } ############ sub groups { print "
This is a story about a group $event. "; } ########################## #************************ ########################## #places sub routine called by 'places' funcion: sub bakery { print "
This $ev took place in the bakery. A $actor was involved in it. "; print "
"; print "What do we know about bakeries? Another function will have to be called to answer this."; } ############ sub pub { print "
This $ev took place in the pub. A $actor was involved in it "; print "
"; print "What do we know about the pub? Its called the Bedford Another function will have to be called for more ddetail"; } ############## sub cibaa_cafe { print "
This $ev took place in the Cibaa Cafe. A $actor was involved in it "; print "
"; print "What do we know about the Cibaa Cafe, its spelt unusually? Another function will have to be called"; } ############## sub supermarket { print "
This $ev took place in the supermarket in the middle of The Dip. A $actor was involved in it. "; print "
"; print "What do we know about this supermarket? Another function will have to be called. "; &supermarket2; } ########################## #************************ ########################## #detail about places: sub supermarket2 { print "
We do know this $ev took place in the supermarket and a $actor was involved in it. "; print "
"; print "Things happen in supermarkets. Things get bought, people meet each other. People want things. People steal things. "; print "
"; print "People might enjoy being here ."; print "We know this $event took place here in the supermarket, the \"Legion Mini Mart\", which is never called that; "; print "
"; print "its always called the\" supermarket in The Dip.\""; print " So a $actor and a $actor2 was involved with a $ev in the supermarket"; print "
But what is a $ev? We need another function to clarify this "; print &storyy; print " .It could have involved the $ev of "; print &super_marketStuff." or "; print &super_marketStuff2; print "
Perhaps we should check what a $actor is while we're at it? Yet another function will be required"; ###NEED MORE GENERATIVE ASPECTS, what is stolen can this be generated by parameter? } sub story1{ @story = ("story","text","tale", "passage", "fabula", "fiction"); $story_length = @story; $story_word = rand($story_length); $stor = int($story_word); return $story[$stor]; } ###################things for places sub storyy{ @story = ("situation.","concept.","dilemma.", "idea.", "story.", "word"); $story_length = @story; $story_word = rand($story_length); $stor = int($story_word); return $story[$stor]; } sub super_marketStuff{ @story = ("money","milk","beer", "chocolate", "a candle", "a tin of beans"); $story_length = @story; $story_word = rand($story_length); $stor = int($story_word); return $story[$stor]; } sub super_marketStuff2{ @story = (" cigarettes"," identities"," vodka", " sweets", " socks", " crisps"); $story_length = @story; $story_word = rand($story_length); $stor = int($story_word); return $story[$stor]; } sub cafe_stuff{ @story = (" tea"," cards"," mint tea", " milky coffee in glasses", " secret meetings", " arguments"); $story_length = @story; $story_word = rand($story_length); $stor = int($story_word); return $story[$stor]; } #############