home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / S-Z / SLB36HLP.LBR / SYSLIBH.HZP / SYSLIBH.HLP
Text File  |  2000-06-30  |  2KB  |  68 lines

  1. :Random Number Generator Routines
  2.  
  3.      The Random Number Generator Routines are:
  4.  
  5.           RNDINIT - Initializes the Generator Seed on user
  6.                          keypress
  7.           RNDSEED - Allows user to provide a seed
  8.           RND - Returns a Pseudo-Random Number
  9.  
  10.  
  11.      Routine:  RNDINIT
  12.  
  13.      Function:
  14.  
  15.      RNDINI╘ enter≤ ß countinτ loop¼ waitinτ fo≥ thσ use≥ t∩ ì
  16. strikσá ß ke∙ a⌠ hi≤ console«á  I⌠ theε set≤ thσ seeΣá valuσ ì
  17. fo≥á thσ randoφ numbe≥ generato≥ baseΣ upoε it≤ coun⌠á valuσ ì
  18. a⌠á thσá instan⌠ oµ keypress«á  Thσ seeΣ valuσ i≤á aεá 8-bi⌠ ì
  19. quantit∙á maintaineΣ interna∞ t∩ thσ Randoφ Numbe≥ Generato≥ ì
  20. module.
  21.  
  22.      Inputs:  None (User Keypress)
  23.  
  24.      Outputs:  None  (Seed is set)
  25.  
  26.      Registers Affected:  None
  27.      SYSLIB Routines Called:  CONDIN, RND
  28.      Special Error Conditions:  None
  29.      Routine:  RNDSEED
  30.  
  31.      Function:
  32.  
  33.      Thi≤á routinσá allow≤ thσ use≥ t∩ providσ ß seeΣá valuσ ì
  34. fo≥ thσ randoφ numbe≥ generator«á  Thσ seeΣ i≤ passeΣ iε thσ ì
  35. ┴á registe≥á anΣá storeΣá interna∞á t∩á thσá Randoφáá Numbe≥ ì
  36. Generato≥ modulσ fo≥ late≥ usσ b∙ thσ RN─ routine.
  37.  
  38.      Inputs:  A = Seed
  39.  
  40.      Outputs:  None  (Seed is set)
  41.  
  42.      Registers Affected:  None
  43.  
  44.      SYSLIB Routines Called:  RND
  45.  
  46.      Special Error Conditions:  None
  47.  
  48.  
  49.      Routine:  RND
  50.  
  51.      Function:
  52.  
  53.      Thi≤ i≤ thσ user-callablσ randoφ numbe≥ generator«á  I⌠ ì
  54. return≤á ßá pseudo-randoφ numbe≥ (8-bit⌐ iε thσá ┴á registe≥ ì
  55. wheε called«  It≤ seeΣ valuσ ha≤ beeε se⌠ b∙ ß previou≤ cal∞ ì
  56. t∩ RNDINI╘ o≥ RNDSEED.
  57.  
  58.      Inputs:  None
  59.  
  60.      Outputs:  A = Random Number
  61.  
  62.      Registers Affected:  PSW
  63.  
  64.      SYSLIB Routines Called:  None
  65.  
  66.      Special Error Conditions:  None
  67.  
  68.