davea@vlsi.ll.mit.edu (Dave Allen) (08/30/88)
Somebody recently mentioned the function RangeRand in amiga.lib. I used it in a program and it turns out that each time I run the program it generates the same random sequence. What is the function in amiga.lib that initializes the random seed? What parameters does it need? I've looked through the original RKMs (the big white telephone books) but there's no information on amiga.lib. ADVthanksANCE (Thanks in advance), Dave Allen: internet davea@vlsi.ll.mit.edu
bryce@cbmvax.UUCP (Bryce Nesbitt) (09/02/88)
In article <148@vlsi.ll.mit.edu> davea@vlsi.ll.mit.edu (Dave Allen) writes: >Somebody recently mentioned the function RangeRand in amiga.lib.... >...What is the function in amiga.lib that initializes the random seed? There is none. You need to add to your code a: extern ULONG RangeSeed; /* For C */ XREF _RangeSeed ;For assembly And set it to your start seed. Usually the number of clock ticks since the machine was powered on is a good place to start the seed. Note that a previous document for this function listed the above as a UWORD. That was wrong! -Bryce