'ARRAY OF RANGED RANDOM NUMBERS

uses console

! GetTickCount lib "kernel32.dll" () as long
long seed=GetTickCount 'randomize

function mrand(long z1,z2,*p,n)
===============================
mov ecx,n
addr esi,p
mov edi,seed
sub esi,4
(
 add esi,4
 dec ecx
 jl exit
 mov eax,z2
 sub eax,z1
 inc eax
 imul edx,edi,0x8088405
 inc edx
 mov edi,edx
 mul edx
 add edx,z1
 mov [esi],edx
 repeat
)
mov seed,edi
end function


long ra[1000] : mrand(1,100,ra,1000)
int i
for i=990 to 1000 : printl ra[i] : next
waitkey
