Category : Miscellaneous Language Source Code
Archive   : MTD.ZIP
Filename : RANDOM.PAS

 
Output of file : RANDOM.PAS contained in archive : MTD.ZIP
{$N+,E+} { Coprocessor or emulation }
program stacked;
uses crt;

const
MAXLONG = $7FFFFFFF;
var
seed : longInt;

function random( var seed : longInt ) : double;
const
M = 25173;
C = 13849;
begin
random := seed / MAXLONG;
seed := ( M * seed + C ) mod MAXLONG;
end; { random }

begin
write( 'Seed? ' );
readln( seed );
while not keypressed do
write( random( seed ):20:8 )
end.


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : MTD.ZIP
Filename : RANDOM.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/