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

  1. // %PARAMETERS = "CH13LIST C:\UT2004"
  2. //Identifies the package
  3. //CH13_08LIST.uc
  4.  
  5. class CH13_08LIST extends Commandlet;
  6. function int Main(string Args){
  7.  
  8. // #1
  9. local string szRWE, szHDT, szSMF, szCST, 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. //Caroline Sturgis Tappan
  33. szCST = "   Caroline Sturgis Tappan -- "   $ Chr(10) $
  34.             "   Lyric , Life"    $ Chr(10) $
  35.             "   Art and Artist"    $ Chr(10) $
  36.             "   Lines , The Hero";
  37.  
  38. // #2
  39. //Generate a random number
  40. //Convert number to a character
  41.  
  42.  iItr = 1 + Rand(4);
  43.  iItr += 96; //Make it 97, 98, 99, 100;
  44.  szChar = Chr(iItr);
  45.  
  46.  
  47. Log(Chr(10) $ " CH13_08LIST " $  Chr(10));
  48. //#3
  49. //Perform selections
  50. //if  author a, then Emerson
  51.  
  52.  if(szChar  == "a"){
  53.      szToPrint =  szRWE;
  54.  }
  55.  else if(szChar  == "b"){    // if Fuller
  56.      szToPrint =  szSMF;
  57.  }
  58.  else if(szChar  == "c"){
  59.      szToPrint = szHDT;
  60.  }
  61.   else{
  62.      szToPrint = szCST;
  63.  }
  64.  
  65.  Log( "(" $ szChar  $ ")" $ szToPrint  $ Chr(10));
  66.  
  67.    return 0;
  68. }
  69.