home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / APIEXAM / PHIL / RANDOM_G.ADB < prev    next >
Text File  |  1996-06-05  |  621b  |  20 lines

  1. --random_generic.adb
  2. with Ada.Numerics.Discrete_Random;
  3. package body Random_G is
  4.  
  5.   -- Body of random number generator package.
  6.   -- Uses Ada 95 random number generator; hides generator parameters
  7.   -- Michael B. Feldman, The George Washington University, June 1995.
  8.  
  9.   package Ada95_Random is new Ada.Numerics.Discrete_Random
  10.     (Result_Subtype => Result_Subtype);
  11.   G: Ada95_Random.Generator;
  12.   function Random_Value return Result_Subtype is
  13.   begin
  14.     return Ada95_Random.Random(Gen => G);
  15.   end Random_Value;
  16.  
  17. begin
  18.   Ada95_Random.Reset(Gen => G);  -- time-dependent initialization
  19. end Random_G;
  20.