Advertisement
Guest User

Friday Puzzler: The Quest for Foo

a guest
Nov 11th, 2011
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cfset WordRepository = StructNew()>
  2.  
  3. <cfset WordRepository.FirstNames = 'Kurt, James, Steven, Mark, John, Jamie, Adam, Rocky, Seth, Nigel, Kristian, Daniel, Patrick, Chris, Jermaine, Tyrone, Micheal, Joshua, Peter, Luke, Ryan, Kevin, Mohammed, Sairab'>
  4.  
  5. <cfset WordRepository.SecondNames = 'Van Damm, Russel, Swartznegger, Stallone, Davidson, Balboa, Daniels, O''Grady, Platts, Tosney, Crumbie, Avezedo, Camden, Slater, Owen, Simmonds, Wilkinson, Khan, Shah, Ali, Kilgallon, Whalley'>
  6.  
  7. <cfset WordRepository.Title = 'Sir, Agent, Don, Dr, Master'>
  8.  
  9. <cfset WordRepository.Task = 'Obliterate, Defeat, Destroy, Kill, Crush, Cannibalize, seduce, Lambast, Teabag'>
  10.  
  11. <cfset WordRepository.Prize = 'The Women, Our Women, The Gold, The Treasure, The City, The Children, The Swag, Our Medals, Our Future, The Money, Our Money, All The Pies, all our base, '>
  12.  
  13. <cfset StorySelect = RandRange(1,4)>
  14.  
  15. <cfset HeroName = ListGetAt(WordRepository.FirstNames, RandRange(1, ListLen(WordRepository.FirstNames))) & ' ' & ListGetAt(WordRepository.SecondNames, RandRange(1, ListLen(WordRepository.SecondNames)))>
  16.  
  17. <cfset VillainName = ListGetAt(WordRepository.FirstNames, RandRange(1, ListLen(WordRepository.FirstNames))) & ' ' & ListGetAt(WordRepository.SecondNames, RandRange(1, ListLen(WordRepository.SecondNames)))>
  18.  
  19. <cfset HeroTitle = ListGetAt(WordRepository.Title, RandRange(1, ListLen(WordRepository.Title)))>
  20.  
  21. <cfset HeroTask = ListGetAt(WordRepository.Task, RandRange(1, ListLen(WordRepository.Task)))>
  22.  
  23. <cfset HeroPrize = ListGetAt(WordRepository.Prize, RandRange(1, ListLen(WordRepository.Prize)))>
  24.  
  25. <cfif HeroName EQ VillainName>
  26.     <cflocation url="fridaypuzzler.cfm">
  27. </cfif>
  28.  
  29. <cfswitch expression="#StorySelect#">
  30.     <cfcase value="1">
  31.         <cfset storyoutput = HeroTitle & ' ' & HeroName & ' it has recently come to our attention that ' & VillainName & ' has been stealing ' & HeroPrize & '. You must ' & HeroTask & VillainName & ' to ensure the safety of' & HeroPrize & '. We are all counting on you ' & HeroName & ', do not let us down!'>
  32.     </cfcase>
  33.     <cfcase value="2">
  34.         <cfset storyoutput = 'There has been a raid on ' & HeroPrize & ' by the dastardly ' & VillainName & '. The people have chosen you, ' & HeroTitle & ' ' & HeroName & ' as their champion. ' & HeroTask & ' all comers on the road to ' & HeroTask & ' ' & VillainName & '!'>
  35.     </cfcase>
  36.     <cfcase value="3">
  37.         <cfset storyoutput = HeroPrize & ' is continually being threatened by ' & VillainName & ' and his gang of hoodlums. The time has come for ' & HeroTitle & ' ' & HeroName & ' to once again ' & HeroTask & ' ' & VillainName & ' and ' & HeroPrize & ' will finally be safe.'>
  38.     </cfcase>
  39.     <cfcase value="4">
  40.         <cfset storyoutput = 'Stop ' & VillainName & ' before it is too late and he ' & HeroTask & ' you. ' & HeroName & ' , it is vital for ' & HeroPrize & ' that you do not fail!'>
  41.     </cfcase>
  42. </cfswitch>
  43.  
  44. <cfoutput>#storyoutput#</cfoutput>
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement