'=========================================================================== ' Subject: RANDOM NUMBER GENERATOR IN ASM Date: 03-23-99 (21:16) ' Author: Nigel Traves Code: QB, PDS ' Origin: tarot@ihalliwell.freeserve.co.u Packet: ALGOR.ABC '=========================================================================== ' Random number generator in assembly DEFINT A-Z:DIM SHARED K,S,B&,Z&:V1 'Created by PostIt! 7.2 SUB V1:OPEN "O",1,"RANDOM.ZIP",4^6:Z&=7222:?STRING$(50,177); U"%up()%9%'%m-%%)ADK/J*De)'7%%-+%%%-%%%%wf%siSf.xrly3:]jUa56HjL(J U"i*LT7d%/yyQJa1epM-QTgbA&12o0m['dFF+4 U"+&$WHF6m(s1(RH/RIvPz>hy:j%9Wn())mY8YH0fcL_Kn_'R3fGWlEb6(Fd>_d-x U"UiZ.dQKXI/=IRA]bKeE([XrYL\^vHX:gtl3fc_ZJu[nkJ_C1FBkoknM4SdC;ZPd_w1SVb1o2h/JG_SaNoQ9i,8-MSk&God>Wo,29gGNe](D( U"e//9&NJYQ+r?,m9;zPp)0dT#&Vvy94VhJp\q)4On(v\f4K)RMU<\U-ldBuHb U"L$-'^7YR+AdO<2gzr)l7x7:HAoq5kWo+aPLp,)g+7dFiMBB]1*mrhAt)4q]eTPd U",AQ6R7?$43q)2YCGOSSa2-jb4;[m/]d#r5d^t\Ex;l[0+r;x5fUOiCUgV#l4*4N U"up%()9%%'%-%23Gk%T=T.]5LT3INg+% U"U[N7LHfERu_F2-gMiI,PEKq^ecYa1JtmdsZeshFPU3']0VYjK&*cn;Z$iEh%Xht U"S=c;D,?&$Hg4Q5d/_,XV9(.O:_d>/&MC4$)^]G4HZto83QN^92dP[cV>COQrz&Z U"b33J?C^JXj$t9G(Z*MqEAeg=$e*;hvo]cQ U"<>1S[#S?ePVDiOF;55F4?XTuU5^V%&?H];tU=B7$aQr\zjx,oN):C/V.G[(cl1A U"yGJ2I]\T_0sLkDN)emsT,i^B82f=V5eWP[jeKf?]BmOb:<_kl06%4gjf3'sd^6T U"A+-:olU*PMi=GI(A-k$g_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