Give this a test run, and you can see what the problem is:
RANDOMIZE TIMER
DIM SHARED numCards AS INTEGER
numCards = 52
DIM SHARED maxSets AS LONG
maxSets = 80000
DIM SHARED Ruscell(maxSets) AS STRING
DIM SHARED Code AS STRING
FOR a = 97 TO 122: Code = Code + CHR$(a): NEXT
FOR a = 65 TO 90: Code = Code + CHR$(a): NEXT
DIM t AS LONG
DIM p AS SINGLE
DIM total AS LONG
DIM test AS STRING
DIM Cardset AS STRING
Ruscell(1) = newSet
total = 2
LOCATE 24, 2: PRINT "Loading....";
DO
Cardset = newSet
LOCATE 1, 1: PRINT Cardset
test = "Good"
FOR t = 1 TO total - 1
IF Cardset = Ruscell(t) THEN
test = "Bad"
PRINT total, t, "MATCH"
SLEEP
EXIT FOR
END IF
NEXT
IF test = "Good" THEN
Ruscell(total) = Cardset
total = total + 1
END IF
p = (100 * total) / maxSets
COLOR _RGB(218, 165, 32)
LOCATE 24, 38: PRINT USING "###%"; p;
COLOR _RGB(192, 192, 192)
LOCATE 24, 74: PRINT USING "##,###"; total;
p = (80 * total) / maxSets
COLOR _RGB(218, 165, 32)
LOCATE 25, 1: PRINT STRING$(p, 219);
LOOP UNTIL total = maxSets
END
FUNCTION newSet$
DIM temp AS STRING
DIM Cards AS STRING
card = 1
WHILE card <> numCards + 1
tag = INT(numCards * RND) + 1
temp = MID$(Code, tag, 1)
IF INSTR(Cards, temp) = 0 THEN
Cards = Cards + temp
card = card + 1
END IF
WEND
newSet = Cards
END FUNCTION
For you first 71,142 sets, you don't generate any duplicate values. At set number 71,143, you simply get repeat cycles and generate the same lists endlessly over and over...
Remember, RND only generates a pseudo-random set of numbers for us, based off a formula, and it repeats itself in a cyclic pattern. That's what you're seeing here. What you need is a different method to shuffle the card pattern, without repeating the same sets over time. I'll play around and see what I can come up with to see if I can work around the issue. :)