home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh13 / CH13LIST / Classes / CH13_07LIST.uc < prev    next >
Encoding:
Text File  |  2006-02-06  |  1.6 KB  |  59 lines

  1. // %PARAMETERS = "CH13LIST C:\UT2004"
  2. //Identifies the package
  3. //CH13_07LIST.uc
  4.  
  5. class CH13_07LIST extends Commandlet;
  6. function int Main(string Args){
  7.  
  8. // #1
  9. local string szRWE, szHDT, szSMF, szChar, szToPrint;
  10. local int iItr;
  11. iItr = 0;
  12.  
  13. // Define information for the three authors
  14. //Ralph Waldo Emerson
  15. szRWE = "   Ralph Waldo Emerson -- " $ Chr(10) $
  16.             "   The Apology, Uriel, Destiny"     $ Chr(10) $
  17.             "   Each and All, The Eternal Pan"   $ Chr(10) $
  18.             "   Hamatreya, Earth-Song, Brahma";
  19. //Henry D. Thoreau
  20. szHDT = "   Henry D. Thoreau -- " $ Chr(10) $
  21.             "   Sympathy  , Sic Vita"             $ Chr(10) $
  22.             "   Friendship, Prayer"               $ Chr(10) $
  23.             "   Independence, The Inward Morning" $ Chr(10) $
  24.             "   My Love Must Be as Free";
  25.  
  26. //Sarah Margaret Fuller
  27. szSMF = "   Sarah Margaret Fuller -- "   $ Chr(10) $
  28.             "   Encouragement, Dryad Song"    $ Chr(10) $
  29.             "   The Highlands, Winged Sphinx" $ Chr(10) $
  30.             "   The Passion-Flower";
  31.  
  32. // #2
  33. //Generate a random number
  34. //Convert number to a character
  35.  
  36.  iItr = 1 + Rand(3);
  37.  iItr += 96; //Make it 97, 98, 99;
  38.  szChar = Chr(iItr);
  39.  
  40.  Log(Chr(10) $ " CH13_07LIST " $  Chr(10));
  41. //#3
  42. //Perform selections
  43. //if author a, then Emerson
  44.  if(szChar  == "a"){
  45.         szToPrint =  szRWE;
  46.  }
  47.  else{ //if not then Thoreau or Fuller
  48.      if(szChar  == "b"){    // if Fuller
  49.         szToPrint =  szSMF;
  50.      }
  51.      else{       //leaving only Thoreau, unnamed
  52.         szToPrint = szHDT;
  53.      }
  54.  }
  55.  Log( "(" $ szChar  $ ")" $ szToPrint  $ Chr(10));
  56.  
  57.    return 0;
  58. }
  59.