=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 04-24-93 (18:04) Number: 62 From: RAY CARSON Refer#: NONE To: JEFF FREEMAN Recvd: NO Subj: RANDOM Conf: (35) Quick Basi --------------------------------------------------------------------------- Jeff Freeman, > Ya know, I am *sick* of BASIC's RND. It's damn near worthless. > I wrote Farkl (dice game) and I'll be darned if it doesn't pop up > with 3 of a kind, 4 of a kind, sometimes 5 of a kind (which SHOULD > be pretty friggin rare!). I finally If you want to generate random numbers without any duplicates then you can use the following code. DEFINT A-Z DECLARE SUB RNDint (Min, Max, N) CLS CONST True = -1, False = NOT True REDIM Nbr(5) RANDOMIZE TIMER FOR X = 1 TO 5 DO CALL RNDint(1, 50, N) 'set range from 1 to 50 NoMatch = True 'Texas Lotto FOR J = 1 TO 5 IF N = Nbr(J) THEN NoMatch = False EXIT FOR END IF NEXT LOOP UNTIL NoMatch Nbr(X) = N PRINT Nbr(X) NEXT SUB RNDint (Min, Max, N) DO N = INT(RND * (Max + 1)) LOOP UNTIL N >= Min END SUB --- T.A.G. 2.6d Standard * Origin: BackDraft BBS >The Programers Nightmare 409-539-6879 (1:106/6879) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 575 950 203/23 209/209 SEEN-BY: 280/1 390/1 396/1 15 397/2 2230/100 2440/5 3603/20