home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Utilities / Randoms / main < prev    next >
Encoding:
Text File  |  1991-09-21  |  550 b   |  35 lines  |  [TEXT/PJMM]

  1. program RandTest;
  2.     uses
  3.         Randoms;
  4.  
  5.     const
  6.         MAXINT = 400;
  7.         NUMPERHOLE = 200;
  8.  
  9.     var
  10.         numbers: array[1..MAXINT] of integer;
  11.         loop: Longint;
  12.         index: integer;
  13.  
  14.  
  15. begin
  16.     InitRandoms;
  17.     for loop := 1 to 10000 do
  18.         begin
  19. {• UNCOMMENT ONE OF THESE THREE INDEX ASSIGNMENTS •}
  20.  
  21. {index := normal((200), 50, 5);}
  22. {index := uniform(1, 400, 5);}
  23. {index := exponent(20, 5);}
  24.             numbers[index] := numbers[index] + 1;
  25.         end;
  26.     ShowDrawing;
  27.     for loop := 1 to MAXINT do
  28.         begin
  29.             Moveto(loop, trunc(numbers[loop] * (100 / NUMPERHOLE)));
  30.             Line(0, 1);
  31.         end;
  32.  
  33.  
  34.  
  35. end.