in reply to Solver for the game "Set" matches three times

Here is an easy filter: Print only those sets where the three cards are in ascending order. This presumes that the cards have some sort of order/number associated with them. So you would print cards 0 5 and 12, but not cards 5, 12 and 0 or cards 12, 5 and 0.

If you don't have the card number available at that time you can construct one: If the card is (a,b,c,d), the number is a+b*3+c*9+d*27.

Obviously you can do this filtering not only as late as when you print but also when you generate the combos and when you search for the third card (i.e. start with the search one card after the second of the two combo cards and expect to find no third card in some cases).

  • Comment on Re: Solver for the game "Set" matches three times