Well, I finally found a description of "Set" at
http://www.setgame.com/set/rules_set.htm
Dang! That was hard to find. Never heard of the game, and "set" is a very common word. Might as well have named that game "the" or "is".
Anyway, it appears you have a deck consisting of cards that four attributes and three values for each attribute.
Getting away from all the red/green/squiggle,solid,etc. mumbo-jumble, we can say the cards are
1 1 1 1
1 1 1 2
1 1 1 3
1 1 2 1
1 1 2 2
1 1 2 3
etc. to
3 3 3 2
3 3 3 3
where, for example, 2 1 3 2 would mean Attribute 1 is 2, Attribute 2 is 1, Attribute 3 is 3 and Attribute 4 is 2.
I would imagine your first task is to prepare an array of the 81 cases. For simplicity of array, but complexity of program, you could use
dim a(81) as string * 4
A(1)="1111", A(2)="1112", ..., A(81)="3333".
Now shuffle the array and place values 1-12 on the board. For example, you might get
Code:
1 1121
2 1321
3 2232
4 2211
5 1132
6 3233
7 1112
8 2333
9 1331
10 3212
11 1221
12 2121
(Fancy version would translate the attributes into fancy "cards" and lay them out in a rectangle and use a mouse to identify a set, but that is best left for later. First get the logic of the program going.)
OK, I don't comprehend the game, but presumably those in the know can pick out "sets" of three by some rule. Let's say the following is a "set":
Code:
1 1121
2 1321
11 1221
The player somehow notifies the program that 1, 2, and 11 form a set.
OK, now finally to answer your question:
We go to the array and take the next 3 and use them. So we want to see
Code:
1 2323
2 3332
11 3311
if that were the next three.
So simply use LOCATE to find lines 1,2,11 and replace the display.
Mac